| Package | PBLabs.Rendering2D |
| Interface | public interface IDrawManager2D |
| Implementors | BaseSceneComponent |
| Property | Defined by | ||
|---|---|---|---|
| LastDrawnItem : IDrawable2D
[read-only]
During drawing, set to the last drawn item or null if there is none (if
this is the first rendered object or first interstitial call).
| IDrawManager2D | ||
| NextDrawnItem : IDrawable2D
[read-only]
During drawing, set to the item that will be drawn next, or null if we
are at the end of the draw list.
| IDrawManager2D | ||
| Method | Defined by | ||
|---|---|---|---|
|
AddAlwaysDrawnItem(item:IDrawable2D):void
Add an item that will always receive an opportunity to render.
| IDrawManager2D | ||
|
AddInterstitialDrawer(item:IDrawable2D):void
Some renderers need to draw in between everything else in order to
sort right, and it isn't possible to manually add IDrawable2Ds at
every location.
| IDrawManager2D | ||
|
CopyPixels(bitmapData:BitmapData, offset:Point):void
| IDrawManager2D | ||
|
DrawBitmapData(bd:BitmapData, m:Matrix):void
Called from IDrawable2D.OnDraw to render a BitmapData to the screen.
| IDrawManager2D | ||
|
DrawDisplayObject(object:DisplayObject):void
Called from IDrawable2D.OnDraw to render a DisplayObject to the screen.
| IDrawManager2D | ||
|
GetBackBuffer():BitmapData
Get the current results of rendering as a BitmapData.
| IDrawManager2D | ||
|
RemoveAlwaysDrawnItem(item:IDrawable2D):void
Remove an item added by AddAlwaysDrawnItem.
| IDrawManager2D | ||
|
RemoveInterstitialDrawer(item:IDrawable2D):void
Remove an interstitial drawer previously registered with
AddInterstitialDrawer.
| IDrawManager2D | ||
|
TransformScreenToWorld(p:Point):Point
Transform a screen position in pixels into a worldspace coordinate.
| IDrawManager2D | ||
|
TransformWorldToScreen(p:Point, altitude:Number = 0):Point
Transform a world position to screen space in pixels.
| IDrawManager2D | ||
| LastDrawnItem | property |
LastDrawnItem:IDrawable2D [read-only]During drawing, set to the last drawn item or null if there is none (if this is the first rendered object or first interstitial call).
Implementation public function get LastDrawnItem():IDrawable2D
| NextDrawnItem | property |
NextDrawnItem:IDrawable2D [read-only]During drawing, set to the item that will be drawn next, or null if we are at the end of the draw list.
Implementation public function get NextDrawnItem():IDrawable2D
| AddAlwaysDrawnItem | () | method |
public function AddAlwaysDrawnItem(item:IDrawable2D):voidAdd an item that will always receive an opportunity to render.
Parametersitem:IDrawable2D |
| AddInterstitialDrawer | () | method |
public function AddInterstitialDrawer(item:IDrawable2D):voidSome renderers need to draw in between everything else in order to sort right, and it isn't possible to manually add IDrawable2Ds at every location. For instance, a particle system in an isometric perspective has to have an opportunity to draw before and after every object in the scene in order to sort correctly. It would be a huge headache to manually place IDrawable2Ds at every particle location. This registered an "interstitial" drawer with a scene, which is a IDrawable2D which gets called back between every object, as well as at the beginning and ending of rendering. It can use the LastDrawnItem and NextDrawnItem properties to determine what to draw at each call.
Parametersitem:IDrawable2D |
| CopyPixels | () | method |
public function CopyPixels(bitmapData:BitmapData, offset:Point):voidParameters
bitmapData:BitmapData |
|
offset:Point |
| DrawBitmapData | () | method |
public function DrawBitmapData(bd:BitmapData, m:Matrix):voidCalled from IDrawable2D.OnDraw to render a BitmapData to the screen. The BitmapData is placed via the passed matrix. May be called multiple times.
Parametersbd:BitmapData |
|
m:Matrix |
| DrawDisplayObject | () | method |
public function DrawDisplayObject(object:DisplayObject):voidCalled from IDrawable2D.OnDraw to render a DisplayObject to the screen. Uses the transform on the DisplayObject for rendering. May be called multiple times.
Parametersobject:DisplayObject |
| GetBackBuffer | () | method |
public function GetBackBuffer():BitmapDataGet the current results of rendering as a BitmapData. Useful for post processing effects (like glow/blur/motion trails).
ReturnsBitmapData |
| RemoveAlwaysDrawnItem | () | method |
public function RemoveAlwaysDrawnItem(item:IDrawable2D):voidRemove an item added by AddAlwaysDrawnItem.
Parametersitem:IDrawable2D |
| RemoveInterstitialDrawer | () | method |
public function RemoveInterstitialDrawer(item:IDrawable2D):voidRemove an interstitial drawer previously registered with AddInterstitialDrawer.
Parametersitem:IDrawable2D |
See also
| TransformScreenToWorld | () | method |
public function TransformScreenToWorld(p:Point):PointTransform a screen position in pixels into a worldspace coordinate. We currently only support isometric or orthographic projections, so cannot reconstruct a Z coordinate. Results can be assumed to have an altitude of zero.
Parametersp:Point |
Point |
| TransformWorldToScreen | () | method |
public function TransformWorldToScreen(p:Point, altitude:Number = 0):PointTransform a world position to screen space in pixels. Altitude can be passed, but is only meaning in non-orthographic projections. The results from this can be passed directly into the x/y properties on a DisplayObject.
Parametersp:Point |
|
altitude:Number (default = 0) |
Point |