Skip to content
Joel Martinez edited this page Jul 1, 2013 · 7 revisions

Initialization

var ball = engineInstance.SpriteManager.add("http://www.flatredball.com/frb/docs/images/9/99/Frblogo128.png");

Available Properties

  • x
  • y
  • xVelocity
  • yVelocity
  • xAcceleration
  • yAcceleration
  • zRotation
  • zRotationAcceleration
  • zRotationVelocity
  • alpha - range 0 (fully transparent) to 1 (fully opaque)

All sprites are rendered relative to the Camera position.

Texture Coordinates/Sprite Sheets

You can render a subset of a sprite by assigning texture coordinates

// left, right, top, buttom
sprite.addTextureCoordinate(0, .5, 0, 1);

These coordinates are normalized from 0, 1

Samples

Tiling sprites to make a "floor" http://joelmartinez.github.io/flatredball-js/#tiles

Clone this wiki locally