API Docs for: 0.5.5
Show:

kick.core.Graphics Class

Module: kick.core

A helper-class used for rendering.

Item Index

Methods

Methods

drawQuad

(
  • material
  • [normalizedViewportRect=[0,0,1,1]
)
static

Parameters:

drawTexture

(
  • Texture
  • [normalizedViewportRect=[0,0,1,1]
)
static

Parameters:

renderToTexture

(
  • renderTexture
  • material
  • [normalizedViewportRect=[0,0,1,1]
)
static

Parameters:

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);