General Entity related functions.
More...
|
| Entity | Create (string className, number x, number y, value flag=0) |
| | Creates a new instance of an object class, and calls its Create event with the flag.
|
| Entity | GetNth (string className, integer n) |
| | Gets the n'th instance of an object class.
|
| boolean | IsClass (Entity entity, string className) |
| | Determines whether the instance is of a specified object class.
|
| string | GetClass (Entity entity) |
| | Gets the object class of a instance.
|
| integer | GetCount (string className) |
| | Gets amount of currently active instances in an object class.
|
| Entity | GetNextInstance (Entity entity, integer n) |
| | Gets the instance created after or before the specified instance. 0 is the next instance, -1 is the previous instance.
|
| Entity | GetBySlotID (integer slotID) |
| | Gets an instance by its slot ID.
|
| void | DisableAutoAnimate (boolean disableAutoAnimate) |
| | Disables the AutoAnimate function of entities.
|
| void | SetUseRenderRegions (boolean useRenderRegions) |
| | Sets whether entities will use Render Regions when rendering. If false, entities will use their Update Regions instead.
|
| void | Copy (Entity destInstance, Entity srcInstance, boolean copyClass=true) |
| | Copies an instance into another.
|
| boolean | ChangeClass (Entity entity, string className) |
| | Changes an instance's class.
|
General Entity related functions.
◆ ChangeClass()
| boolean Instance.ChangeClass |
( |
Entity | entity, |
|
|
string | className ) |
Changes an instance's class.
- Parameters
-
| entity | The instance to swap. |
| className | Name of the object class. |
- Returns
- Returns whether the instance was swapped.
◆ Copy()
| void Instance.Copy |
( |
Entity | destInstance, |
|
|
Entity | srcInstance, |
|
|
boolean | copyClass = true ) |
Copies an instance into another.
- Parameters
-
| destInstance | The destination instance. |
| srcInstance | The source instance. |
| copyClass | Whether to copy the class of the source entity. |
◆ Create()
| Entity Instance.Create |
( |
string | className, |
|
|
number | x, |
|
|
number | y, |
|
|
value | flag = 0 ) |
Creates a new instance of an object class, and calls its Create event with the flag.
- Parameters
-
| className | Name of the object class. |
| x | X position of where to place the new instance. |
| y | Y position of where to place the new instance. |
| flag | Value to pass to the Create event. |
- Returns
- Returns the new instance.
◆ DisableAutoAnimate()
| void Instance.DisableAutoAnimate |
( |
boolean | disableAutoAnimate | ) |
|
Disables the AutoAnimate function of entities.
- Parameters
-
| disableAutoAnimate | Whether to turn off the engine automatically applying AutoAnimate when entities are initialized. |
◆ GetBySlotID()
| Entity Instance.GetBySlotID |
( |
integer | slotID | ) |
|
Gets an instance by its slot ID.
- Parameters
-
| slotID | The slot ID to search a corresponding instance for. |
- Returns
- Returns the instance corresponding to the specified slot ID, or null if no instance was found.
◆ GetClass()
| string Instance.GetClass |
( |
Entity | entity | ) |
|
Gets the object class of a instance.
- Parameters
-
| entity | The instance to check. |
- Returns
- Returns a string value.
◆ GetCount()
| integer Instance.GetCount |
( |
string | className | ) |
|
Gets amount of currently active instances in an object class.
- Parameters
-
| className | Name of the object class. |
- Returns
- Returns count of currently active instances in an object class.
◆ GetNextInstance()
| Entity Instance.GetNextInstance |
( |
Entity | entity, |
|
|
integer | n ) |
Gets the instance created after or before the specified instance. 0 is the next instance, -1 is the previous instance.
- Parameters
-
| entity | The instance to check. |
| n | How many instances after or before the desired instance is to the checking instance. |
- Returns
- Returns the desired instance.
◆ GetNth()
| Entity Instance.GetNth |
( |
string | className, |
|
|
integer | n ) |
Gets the n'th instance of an object class.
- Parameters
-
| className | Name of the object class. |
| n | n'th of object class' instances to get. 0 is first. |
- Returns
- Returns n'th of object class' instances, null if instance cannot be found or class does not exist.
◆ IsClass()
| boolean Instance.IsClass |
( |
Entity | entity, |
|
|
string | className ) |
Determines whether the instance is of a specified object class.
- Parameters
-
| entity | The instance to check. If there is no instance, this automatically returns false. |
| className | Name of the object class. |
- Returns
- Returns whether the instance is of a specified object class.
◆ SetUseRenderRegions()
| void Instance.SetUseRenderRegions |
( |
boolean | useRenderRegions | ) |
|
Sets whether entities will use Render Regions when rendering. If false, entities will use their Update Regions instead.
- Parameters
-
| useRenderRegions | Whether render regions will be used. |