Scaleform Gfx Displayobjectex
DisplayObjectEx
The DisplayObjectEx class resides within the scaleform.gfx package and extends the functionality of the flash.display.DisplayObject class, providing static methods for advanced rendering controls.
It extends functionalities of Flash’s DisplayObject class, providing additional methods specifically tailored for the game’s rendering needs.
This class does not instantiate objects but offers static methods that manipulate existing DisplayObject instances.
It includes methods for enabling or disabling batching, setting renderer-specific parameters, and querying these settings.
Table of Content
Constructor
| Constructor | Description |
|---|---|
DisplayObjectEx() |
Initializes a new instance of the DisplayObjectEx class. |
Methods
disableBatching
Disables or enables the batching of rendering commands for the specified DisplayObject.
public static function disableBatching(o:DisplayObject, b:Boolean) : void
Parameters
o: TheDisplayObjectto affect.b: ABooleanvalue wheretruedisables batching andfalseenables it.
isBatchingDisabled
Checks if the batching of rendering commands is disabled for the specified DisplayObject.
public static function isBatchingDisabled(o:DisplayObject) : Boolean
Parameters
o: TheDisplayObjectto check.
Returns
Boolean:trueif batching is disabled,falseotherwise.
setRendererString
Assigns a string to the renderer for the specified DisplayObject.
public static function setRendererString(o:DisplayObject, s:String) : void
Parameters
o: TheDisplayObjectto set the string for.s: The string to assign to the renderer.
getRendererString
Retrieves the renderer string for the specified DisplayObject.
public static function getRendererString(o:DisplayObject) : String
Parameters
o: TheDisplayObjectto retrieve the string from.
Returns
String: The renderer string ornullif none is set.
setRendererFloat
Assigns a floating-point number to the renderer for the specified DisplayObject.
public static function setRendererFloat(o:DisplayObject, f:Number) : void
Parameters
o: TheDisplayObjectto set the float for.f: The floating-point number to assign to the renderer.
getRendererFloat
Retrieves the renderer floating-point number for the specified DisplayObject.
public static function getRendererFloat(o:DisplayObject) : Number
Parameters
o: TheDisplayObjectto retrieve the float from.
Returns
Number: The renderer float orNumber.NaNif none is set.
Filename
DisplayObjectEx.as
Utilization Examples
To disable batching for a DisplayObject instance:
DisplayObjectEx.disableBatching(myDisplayObject, true);
To check if batching is disabled:
var batchingDisabled:Boolean = DisplayObjectEx.isBatchingDisabled(myDisplayObject);
To set a renderer string:
DisplayObjectEx.setRendererString(myDisplayObject, "exampleRenderer");
To get a renderer string:
var rendererString:String = DisplayObjectEx.getRendererString(myDisplayObject);
To set a renderer float:
DisplayObjectEx.setRendererFloat(myDisplayObject, 1.23);
To get a renderer float:
var rendererFloat:Number = DisplayObjectEx.getRendererFloat(myDisplayObject);