Packagenet.flashpunk
Classpublic class Graphic
InheritanceGraphic Inheritance Object
Subclasses Canvas, Emitter, Graphiclist, Image, Stamp

Base class for all graphical types that can be drawn by Entity.



Public Properties
 PropertyDefined By
  active : Boolean = false
If the graphic should update.
Graphic
  relative : Boolean = true
If the graphic should render at its position relative to its parent Entity's position.
Graphic
  scrollX : Number = 1
X scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
  scrollY : Number = 1
Y scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
  visible : Boolean = true
If the graphic should render.
Graphic
  x : Number = 0
X offset.
Graphic
  y : Number = 0
Y offset.
Graphic
Protected Properties
 PropertyDefined By
  assign : Function
Graphic
Public Methods
 MethodDefined By
  
Constructor.
Graphic
  
render(target:BitmapData, point:Point, camera:Point):void
Renders the graphic to the screen buffer.
Graphic
  
update():void
Updates the graphic.
Graphic
Property Detail
activeproperty
public var active:Boolean = false

If the graphic should update.

assignproperty 
assign:Function


Implementation
    protected function get assign():Function
    protected function set assign(value:Function):void
relativeproperty 
public var relative:Boolean = true

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

scrollXproperty 
public var scrollX:Number = 1

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.

scrollYproperty 
public var scrollY:Number = 1

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.

visibleproperty 
public var visible:Boolean = true

If the graphic should render.

xproperty 
public var x:Number = 0

X offset.

yproperty 
public var y:Number = 0

Y offset.

Constructor Detail
Graphic()Constructor
public function Graphic()

Constructor.

Method Detail
render()method
public function render(target:BitmapData, point:Point, camera:Point):void

Renders the graphic to the screen buffer.

Parameters

target:BitmapData — The buffer to draw to.
 
point:Point — The position to draw the graphic.
 
camera:Point — The camera offset.

update()method 
public function update():void

Updates the graphic.