com.haxepunk.Graphic

type
class
subclasses
com.haxepunk.graphics.Canvas, com.haxepunk.graphics.Emitter, com.haxepunk.graphics.Graphiclist, com.haxepunk.graphics.Image, com.haxepunk.graphics.Stamp, com.haxepunk.graphics.prototype.Circle, com.haxepunk.graphics.prototype.Rect

Constructor

new()
Constructor.

Instance Variables

active : Bool

If the graphic should update.

layer(default,set_layer) : Int

The layer to use for rendering, should only be set by the Entity

relative : Bool

If the graphic should render at its position relative to its parent Entity's position.

scrollX : Float

X scrollfactor, effects how much the camera offsets the drawn graphic. Can be used for parallax effect, eg. Set to 0 to follow the camera, 0.5 to move at half-speed of the camera, or 1 (default) to stay still.

scrollY : Float

Y scrollfactor, effects how much the camera offsets the drawn graphic. Can be used for parallax effect, eg. Set to 0 to follow the camera, 0.5 to move at half-speed of the camera, or 1 (default) to stay still.

visible : Bool

If the graphic should render.

x : Float

X offset.

y : Float

Y offset.

Instance Methods

destroy() : Void

Removes the graphic from the scene

render(target : flash.display.BitmapData, point : flash.geom.Point, camera : flash.geom.Point) : Void

parameters
target The buffer to draw to.
point The position to draw the graphic.
camera The camera offset.
Renders the graphic to the screen buffer.

setEntity(entity : Entity) : Void

update() : Void

Updates the graphic.