Class: CocosTools

CocosTools

new gdjs.CocosTools()

Common tools that can be used for rendering with Cocos2d-JS.

Methods

staticgdjs.CocosTools.getDefaultVertexShader()

staticgdjs.CocosTools.getEffect()

Get the shader and its uniforms name for an effect

staticgdjs.CocosTools.hexToCCColor()

staticgdjs.CocosTools.isHTML5()

staticgdjs.CocosTools.makeLightNightShader()

staticgdjs.CocosTools.makeNightShader()

staticgdjs.CocosTools.makeSepiaShader()

staticgdjs.CocosTools.makeTilingShader()

Create a shader that can be applied on a cc.Sprite to make it tiled. You have to apply the shader with setShaderProgram and make sure to update the shaders uniforms: uPixelSize (using texture size), uFrame and uTransform (using texture and object size).

staticgdjs.CocosTools.setUniformLocationWith1f()

staticgdjs.CocosTools.setUniformLocationWith2f()

staticgdjs.CocosTools.setUniformLocationWith4f()