Core API Reference: Entity Common
From Color Infection Wiki
Get Entity Id
Get entity id.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Entity Id
- the id of the input entity. If the entity is null, -1 will be returned.
Get Another Entity by Id Offset
Get another entity by an id offset.
Input Parameters:
- Base Entity
- the base entity
- Id Offset
- id offset.
Output Parameters:
- Another Entity
- another entity
Is Visible?
Whether or not an entity is visible.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Visible?
- the visibility of the entity
Set Visible
Set the visibility of an entity.
Input Parameters:
- The Entity
- the entity
- Visible?
- the visibility of the entity
Output Parameters:
- (none)
Get Alpha
Get the alpha (transparency) of an entity. The value is between 0.0 and 1.0. This attribute is meaningless for some entities.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Alpha
- the alpha of the entity
Set Alpha
Set the alpha of an entity.
Input Parameters:
- The Entity
- the entity
- Alpha
- the alpha of the entity. The value should be between 0.0 and 1.0.
Output Parameters:
- (none)
Adjust Appearance Order
Adjust the appearance order of the input entity
Input Parameters:
- The Entity
- the entity
- To Top / To Bottom
- true to move the input entity above all other entities, false to move the input entity behinds all other entities
Output Parameters:
- (none)
Adjust Appearance Order Relative To
Adjust the appearance order of the input entity relative to another entity
Input Parameters:
- The Entity
- the entity
- Relative-To Entity
- the relative-to entity
- To Top / To Bottom
- true to move the input entity to the front of the relative-to entity, false to move the input entity behinds the relative-to entity
Output Parameters:
- (none)
Is Enabled?
Whether or not an entity is enabled. Notice: currently, only event handlers can be set disabled.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Enabled?
- whether or not the entity is enabled
Set Enabled
Set an entity enabled or not. Notice: currently, only event handlers can be set disabled.
Input Parameters:
- The Entity
- the entity
- Enabled?
- true to set the entity enabled, false to set the entity disabled.
Output Parameters:
- (none)
Get Position
Get the position of an entity.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- x
- the position x
- y
- the position y
Get Rotation (By Radians)
Get the rotation (radians) of an entity.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Rotation (radians)
- the rotation in radians. Value range: [0, 2π).
Get Rotation (By Degrees)
Get the rotation (degrees) of an entity.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Rotation (degrees)
- the rotation in degrees. Value range: [0, 360).
Get Accumulated Rotation (By Radians)
Get the accumulated rotation (radians) of an entity. Unlike "Get Rotation (By Radians)", the return value of this API is not limited between 0 and 2π.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Rotation (radians)
- the accumulated rotation in radians.
Is Destroyed?
Whether or not an entity has already destroyed.
Input Parameters:
- The Entity
- the entity
Output Parameters:
- Already Destroyed?
- destroyed or not
Destroy
Destroy an entity.
Input Parameters:
- The Entity
- the entity to be destroyed
Output Parameters:
- (none)
Are 2 Entities Coicided?
Whether or not 2 entities are Coicided with each other. If the differences of position and rotation of the 2 input entities are all smaller the given tolerances, then the function return true.
Input Parameters:
- The Entity 1
- entity 1
- The Entity 2
- entity 2
- Tolerance Delta X
- the tolerance delta x
- Tolerance Delta Y
- the tolerance delta y
- Tolerance Delta Angle (degrees)
- the tolerance delta angle in degrees
Output Parameters:
- Coicided?
- coicided or not