Packagenet.flashpunk.graphics
Classpublic class Backdrop
InheritanceBackdrop Inheritance Canvas Inheritance Graphic Inheritance Object

A background texture that can be repeated horizontally and vertically when drawn. Really useful for parallax backgrounds, textures, etc.



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean = false
If the graphic should update.
Graphic
 Inheritedalpha : Number
Change the opacity of the Canvas, a value from 0 to 1.
Canvas
 Inheritedblend : String
Optional blend mode to use (see flash.display.BlendMode for blending modes).
Canvas
 Inheritedcolor : uint
The tinted color of the Canvas.
Canvas
 Inheritedheight : uint
[read-only] Height of the canvas.
Canvas
 Inheritedrelative : Boolean = true
If the graphic should render at its position relative to its parent Entity's position.
Graphic
 InheritedscrollX : Number = 1
X scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
 InheritedscrollY : Number = 1
Y scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
 Inheritedvisible : Boolean = true
If the graphic should render.
Graphic
 Inheritedwidth : uint
[read-only] Width of the canvas.
Canvas
 Inheritedx : Number = 0
X offset.
Graphic
 Inheritedy : Number = 0
Y offset.
Graphic
Protected Properties
 PropertyDefined By
 Inheritedassign : Function
Graphic
 Inherited_rect : Rectangle
Canvas
Public Methods
 MethodDefined By
  
Backdrop(texture:*, repeatX:Boolean = true, repeatY:Boolean = true)
Constructor.
Backdrop
 Inherited
applyFilter(filter:BitmapFilter):void
Canvas
 Inherited
copyPixels(source:BitmapData, rect:Rectangle, destPoint:Point, alphaBitmapData:BitmapData = null, alphaPoint:Point = null, mergeAlpha:Boolean = false):void
Mimics BitmapData's copyPixels method.
Canvas
 Inherited
draw(x:int, y:int, source:BitmapData, rect:Rectangle = null):void
Draws to the canvas.
Canvas
 Inherited
drawGraphic(x:int, y:int, source:Graphic):void
Draws the Graphic object to the canvas.
Canvas
 Inherited
drawRect(rect:Rectangle, color:uint = 0, alpha:Number = 1):void
Draws over a rectangular area of the canvas.
Canvas
 Inherited
fill(rect:Rectangle, color:uint = 0, alpha:Number = 1):void
Fills the rectangular area of the canvas.
Canvas
 Inherited
fillTexture(rect:Rectangle, texture:BitmapData):void
Fills the rectangle area of the canvas with the texture.
Canvas
 Inherited
getPixel(x:int, y:int):uint
Canvas
 Inherited
render(target:BitmapData, point:Point, camera:Point):void
Renders the graphic to the screen buffer.
Graphic
 Inherited
setPixel(x:int, y:int, color:uint):void
Canvas
 Inherited
shift(x:int = 0, y:int = 0):void
Shifts the canvas' pixels by the offset.
Canvas
 Inherited
update():void
Updates the graphic.
Graphic
Constructor Detail
Backdrop()Constructor
public function Backdrop(texture:*, repeatX:Boolean = true, repeatY:Boolean = true)

Constructor.

Parameters
texture:* — Source texture.
 
repeatX:Boolean (default = true) — Repeat horizontally.
 
repeatY:Boolean (default = true) — Repeat vertically.