kick.core.Graphics Class
A helper-class used for rendering.
Item Index
Methods
- drawQuad static
- drawTexture static
- renderToTexture static
Methods
drawQuad
(
static
-
material
-
[normalizedViewportRect=[0,0,1,1]
Parameters:
-
material
kick.material.Material -
[normalizedViewportRect=[0,0,1,1]
kick.math.Vec4 optional
drawTexture
(
static
-
Texture
-
[normalizedViewportRect=[0,0,1,1]
Parameters:
-
Texture
kick.texture.Texture -
[normalizedViewportRect=[0,0,1,1]
kick.math.Vec4 optional
renderToTexture
(
static
-
renderTexture
-
material
-
[normalizedViewportRect=[0,0,1,1]
Parameters:
-
renderTexture
kick.texture.RenderTexture -
material
kick.material.Material -
[normalizedViewportRect=[0,0,1,1]
kick.math.Vec4 optional
Example:
// render a unlit shader (with color of red) into a texture
texture = new kick.texture.Texture();
texture.setImageData(512, 512, 0, kick.core.Constants.GL_UNSIGNED_BYTE, null, "");
var renderTexture = new kick.texture.RenderTexture({dimension:[512,512], colorTexture: texture});
var shader = engine.project.load(engine.project.ENGINE_SHADER_UNLIT);
var renderMaterial = new kick.material.Material( {
shader:shader,
uniformData: {
mainColor: [1,0,0,1]
}
});
kick.core.Graphics.renderToTexture(renderTexture, renderMaterial);