| Package | flare.display |
| Class | public class DirtySprite |
| Inheritance | DirtySprite flash.display.Sprite |
| Subclasses | DataSprite, LineSprite, RectSprite, TextSprite |
dirty() method should be called whenever a
change is made to the Sprite that would normally require a redraw. This
class will ensure that the Sprite is redrawn only once before the next
frame is rendered.
Subclasses should place drawing code within the render()
method. For all properties used by the render method to help
draw this sprite, the corresponding "setter" method should call the
dirty() method to mark the sprite as dirty and thereby
trigger a redraw for the next frame.
Internally, the DirtySprite class maintains a static list of all
"dirty" sprites, and redraws each sprite in the list when a
Event.RENDER event is issued. Typically, this process is
performed automatically. In a few cases, erratic behavior has been
observed due to a Flash Player bug that results in RENDER
events not being properly issued. As a fallback, the static
renderDirty() method can be invoked to manually force
each dirty sprite to be redrawn.
| Property | Defined by | ||
|---|---|---|---|
| angle : Number The angle value of this sprite's position in polar co-ordinates.
| DirtySprite | ||
| height : Number [read-only]
If dirty, this sprite is re-rendered before returning the height.
| DirtySprite | ||
| origin : Point The origin point for polar coordinates.
| DirtySprite | ||
| radius : Number The radius value of this sprite's position in polar co-ordinates.
| DirtySprite | ||
| width : Number [read-only]
If dirty, this sprite is re-rendered before returning the width.
| DirtySprite | ||
| x : Number [write-only]
| DirtySprite | ||
| y : Number [write-only]
| DirtySprite | ||
| Property | Defined by | ||
|---|---|---|---|
| _angle : Number The angle value of this sprite's position in polar co-ordinates.
| DirtySprite | ||
| _origin : Point The origin point for polar coordinates.
| DirtySprite | ||
| _radius : Number The radius value of this sprite's position in polar co-ordinates.
| DirtySprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new DirtySprite.
| DirtySprite | ||
|
dirty():void
Marks this sprite as "dirty" and in need of re-rendering.
| DirtySprite | ||
|
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered returning the bounds.
| DirtySprite | ||
|
getRect(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered before returning the rect.
| DirtySprite | ||
|
hitTestObject(obj:DisplayObject):Boolean
If dirty, either sprite is re-rendered before hit-testing.
| DirtySprite | ||
|
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
If dirty, this sprite is re-rendered before hit-testing.
| DirtySprite | ||
|
render():void
Draw this sprite's graphical content.
| DirtySprite | ||
|
renderDirty(evt:Event = null):void
[static]
Frame render callback that renders all sprites on the dirty list.
| DirtySprite | ||
|
toString():String
| DirtySprite | ||
| Constant | Defined by | ||
|---|---|---|---|
| ZERO : Point [static] A constant for the point (0,0).
| DirtySprite | ||
| _angle | property |
protected var _angle:Number The angle value of this sprite's position in polar co-ordinates.
Polar coordinate values are assume a circle center given by the
origin property.
| angle | property |
angle:Number [read-write] The angle value of this sprite's position in polar co-ordinates.
Polar coordinate values are assume a circle center given by the
origin property.
public function get angle():Number
public function set angle(value:Number):void
| height | property |
height:Number [read-only]If dirty, this sprite is re-rendered before returning the height.
Implementation public function get height():Number
| _origin | property |
protected var _origin:PointThe origin point for polar coordinates.
| origin | property |
origin:Point [read-write]The origin point for polar coordinates.
Implementation public function get origin():Point
public function set origin(value:Point):void
| _radius | property |
protected var _radius:Number The radius value of this sprite's position in polar co-ordinates.
Polar coordinate values are assume a circle center given by the
origin property.
| radius | property |
radius:Number [read-write] The radius value of this sprite's position in polar co-ordinates.
Polar coordinate values are assume a circle center given by the
origin property.
public function get radius():Number
public function set radius(value:Number):void
| width | property |
width:Number [read-only]If dirty, this sprite is re-rendered before returning the width.
Implementation public function get width():Number
| x | property |
x:Number [write-only]Implementation
public function set x(value:Number):void
| y | property |
y:Number [write-only]Implementation
public function set y(value:Number):void
| DirtySprite | () | constructor |
public function DirtySprite()Creates a new DirtySprite. Registers this Sprite to receive added-to-stage events.
| dirty | () | method |
public final function dirty():voidMarks this sprite as "dirty" and in need of re-rendering. The next time that (a) a new frame is rendered, and (b) this Sprite is on the display list, the render method will automatically be called.
| getBounds | () | method |
public override function getBounds(targetCoordinateSpace:DisplayObject):RectangleIf dirty, this sprite is re-rendered returning the bounds.
ParameterstargetCoordinateSpace:DisplayObject |
Rectangle |
| getRect | () | method |
public override function getRect(targetCoordinateSpace:DisplayObject):RectangleIf dirty, this sprite is re-rendered before returning the rect.
ParameterstargetCoordinateSpace:DisplayObject |
Rectangle |
| hitTestObject | () | method |
public override function hitTestObject(obj:DisplayObject):BooleanIf dirty, either sprite is re-rendered before hit-testing.
Parametersobj:DisplayObject |
Boolean |
| hitTestPoint | () | method |
public override function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):BooleanIf dirty, this sprite is re-rendered before hit-testing.
Parametersx:Number |
|
y:Number |
|
shapeFlag:Boolean (default = false) |
Boolean |
| render | () | method |
public function render():voidDraw this sprite's graphical content. Subclasses should override this method with custom drawing code.
| renderDirty | () | method |
public static function renderDirty(evt:Event = null):voidFrame render callback that renders all sprites on the dirty list. Typically, this method is automatically triggered by stage RENDER events. It can also be manually invoked to redraw all dirty DirtySprites.
Parametersevt:Event (default = null) — the event that triggered the rendering (can be null)
|
| toString | () | method |
public override function toString():StringReturns
String |
| ZERO | constant |
public static const ZERO:PointA constant for the point (0,0).