| Package | com.pblabs.engine.core |
| Interface | public interface IPBObject |
| Implementors | PBObject |
See also
| Property | Defined By | ||
|---|---|---|---|
| alias : String [read-only]
Since the PBE level format references template definitions by name, and
that same name is used to name the entities created by the format, it
is useful to be able to look things up by a common name. | IPBObject | ||
| name : String [read-only]
The name of the PBObject. | IPBObject | ||
| owningGroup : PBGroup
The PBGroup which owns this PBObject. | IPBObject | ||
| Method | Defined By | ||
|---|---|---|---|
destroy():void
Destroys the PBObject by removing all components and unregistering it from
the name manager. | IPBObject | ||
initialize(name:String = null, alias:String = null):void
initializes the PBObject, optionally assigning it a name. | IPBObject | ||
| alias | property |
alias:String [read-only] Since the PBE level format references template definitions by name, and that same name is used to name the entities created by the format, it is useful to be able to look things up by a common name. So you might have Level1Background, Level2Background, Level3Background etc. but give them all the alias LevelBackground so you can look up the current level's background easily.
This is set by the second parameter to #initialize()
public function get alias():String| name | property |
name:String [read-only] The name of the PBObject. This is set by passing a name to the initialize method after the PBObject is first created.
public function get name():StringSee also
| owningGroup | property |
owningGroup:PBGroupThe PBGroup which owns this PBObject. If the owning group is destroy()ed, the PBObject is destroy()ed as well. This is useful for managing object lifespans - for instance, all the PBObjects in a level might belong to one common group for easy cleanup.
public function get owningGroup():PBGroup public function set owningGroup(value:PBGroup):void| destroy | () | method |
public function destroy():voidDestroys the PBObject by removing all components and unregistering it from the name manager.
PBObjects are automatically removed from any groups/sets that they are members of when they are destroy()'ed.
Currently this will not invalidate any other references to the PBObject so the PBObject will only be cleaned up by the garbage collector if those are set to null manually.
| initialize | () | method |
public function initialize(name:String = null, alias:String = null):voidinitializes the PBObject, optionally assigning it a name. This should be called immediately after the PBObject is created.
Parameters
name:String (default = null) — The name to assign to the PBObject. If this is null or an empty
string, the PBObject will not register itself with the name manager.
| |
alias:String (default = null) — An alternate name under which this PBObject can be looked up.
Useful when you need to distinguish between multiple things but refer
to the active one by a consistent name.
|
See also