Reference object that points to an entity in scene. An ETHEntity
must always be used as a reference (@handle). It allows entity direct manipulation. More about entities.
There are several ways to retrieve a reference to a specific entity. The most common way is to use entity callbacks, but they may also be retrieved with functions like SeekEntity
and GetEntitiesFromBucket
.
Examples of in-script ETHEntity
usage:
// Moves the entity to the left void ETHCallback_bullet(ETHEntity@ thisEntity) { thisEntity.AddToPosition(vector3(10,0,0)); }
// finds the starting point in the map ETHEntity @circle = SeekEntity("starting_point.ent"); if (circle !is null) { // Add the main character into the scene, place him at the start point and give him full HP // file name, position, angle int id = AddEntity("character.ent", circle.GetPosition(), 0.0f); ETHEntity @character = SeekEntity(id); character.SetFloat("hp", 100.0f); }
bool AreParticlesOver() | Returns |
bool Collidable() | Returns |
bool EraseData(string name) | Erases a custom variable with matching name. More about custom... |
bool GetFlipX() | Returns true if the sprite is horizontally flipped. ... |
bool GetFlipY() | Returns true if the sprite is vertically flipped. ... |
bool HasCustomData() | Returns |
bool HasLightSource() | Returns |
bool HasParticleSystem() | Returns |
bool HasShadow() | Returns |
bool HasSoundEffect() | Returns |
bool IsAlive() | Returns |
bool IsHidden() | This method tells whether the entity is hidden or not. ... |
bool IsInvisible() | Returns Invisible entities have no sprite... |
bool IsStatic() | Returns |
bool ParticlesKilled(uint slot) | Returns |
bool PlayParticleSystem(uint slot) | Plays a child particle system. It may be used to restore killed particle systems.... |
bool SetFloat(string name, float value) | Sets a custom float variable to the entity. This method will overwrite both type and value if... |
bool SetFrame(uint column, uint row) | Sets the current frame for the entity in a two-dimensional grid if it uses sprite tiling... |
bool SetFrame(uint frame) | Set the current entity frame if it uses sprite tiling (also known as sprite cut). ... |
bool SetInt(string name, int value) | Sets a custom int variable to the entity. This method will overwrite both type and value if... |
bool SetNormal(string fileName) | Changes the current normal map texture. The normal map bitmap file must be in the project's... |
bool SetSprite(string fileName) | Changes the current sprite for the entity. The bitmap file must be in the project's... |
bool SetSpriteCut(uint numColumns, uint numRows) | Resets the current sprite cut (tiling) by equaly sized columns and rows. This method will set the... |
bool SetString(string name, string value) | Sets a custom string variable to the entity. This method will overwrite both type and value if... |
bool SetUInt(string name, uint value) | Sets a custom |
bool SetVector2(string name, vector2 data) | Sets a custom |
bool SetVector3(string name, vector3 data) | Sets a custom |
collisionBox GetCollisionBox() const | Returns the unscaled collision box of this entity. If the entity hasn't been set as collidable in... |
DATA_TYPE CheckCustomData(string name) | Returns the data type of a given custom variable. If there is no matching data for that name,... |
ENTITY_TYPE GetType() | Returns the entity type. The ENTITY_TYPE enum. ... |
ETHPhysicsController@ GetPhysicsController() | Returns a handle to the ... |
float GetAlpha() | Gets the entity alpha (transparency) value where |
float GetAngle() | Gets the entity rotation angle in degrees. ... |
float GetFloat(string name) | Retrieves the value of a custom float variable from entity. If there is no float variable with... |
float GetLayerDepth() | Gets the layer depth from the entity. The layer depth is used to z-sort layerable entities. ... |
float GetLightRange() | Returns the child light range. If the entity has no light source this function returns... |
float GetPositionX() | Faster access to the entity x coordinate. The same as |
float GetPositionY() | Faster access to the entity y coordinate. The same as |
float GetPositionZ() | Faster access to the entity z coordinate. The same as |
float GetShadowZ() | Returns the entity's shadow z position. For a better looking scene, the shadow Z-position must be... |
int GetID() | Returns the current entity ID. The entity ID is an unique number that identifies each entity in... |
int GetInt(string name) | Retrieves the value of a custom int variable from the entity. If there is no int variable with... |
string GetEntityName() | Returns the entity name. By default, the entity name is equivalent to its original file name,... |
string GetString(string name) | Retrieves the value of a custom string variable from the entity. If there is no string with that... |
uint GetFrame() | Returns the entity's current sprite frame. Used on entities that use sprite cut (tiling). ... |
uint GetNumFrames() | Returns the number of frames that the entity has. Used on entities with sprite cut... |
uint GetUInt(string name) | Returns the value of a custom uint variable from the entity. If there is no uint variable with... |
vector2 GetCurrentBucket() | Returns the entity's current bucket key. More about scene... |
vector2 GetPivotAdjust() | Returns the pivot adjust for the entity sprite. The pivot adjust is normally set in the Entity... |
vector2 GetPositionXY() | Returns the X and Y coordinates of the entity position. ... |
vector2 GetScale() | Returns the current entity scale. Global scale is taken into account. ... |
vector2 GetSize() | Returns the current entity sprite size in pixels. This method takes sprite cut and scale into... |
vector3 GetColor() | Returns the entity color. The default entity color is white ( |
vector3 GetEmissiveColor() | Returns the entity emissive (self-illumination) color. The default color is black... |
vector3 GetLightColor() | Returns the light color. If the entity has no light source this method returns... |
vector3 GetPosition() | Returns entity position in world-space. ... |
void AddToAngle(float delta) | Rotates the entity by adding |
void AddToFloat(string name, float value) | Adds |
void AddToInt(string name, int value) | Adds |
void AddToPosition(vector3 direction) | Adds a // move entity to... |
void AddToPositionX(float value) | Adds |
void AddToPositionXY(vector2 direction) | Adds the |
void AddToPositionY(float value) | Adds //... |
void AddToPositionZ(float value) | Adds |
void AddToUInt(string name, uint value) | Adds |
void AddToVector2(string name, vector2 v) | Adds the |
void AddToVector3(string dataName, vector3 v) | Adds the |
void DebugPrintCustomData() const | Prints all the custom variables to the console screen. ... |
void DisableLightSource() | Disables the entity light source if it has one. ... |
void GetObject(string name, ?&out) | Retrieves the @reference to an AngelScript object which has been stored in the entity custom data... |
void Hide(bool hide) | Sets entity visibility. |
void KillParticleSystem(uint slot) | Kills a child particle system. |
void MirrorParticleSystemX(uint slot, bool mirrorGravity) | Mirrors the particle system along the X axis. Set |
void MirrorParticleSystemY(uint slot, bool mirrorGravity) | Mirrors the particle system along the Y axis. Set the |
void MultiplyFloat(string name, float value) | Multiplies a float custom variable by |
void ResolveJoints() | Tries to resolve each Box2D joint declared in the entity, if there are any. More about this... |
void Scale(float scale) | Scales the entity as well as all its light sources and particle systems. // doubles the... |
void Scale(vector2 scale) | Scales the entity as well as all its light sources and particle systems. Different values... |
void ScaleParticleSystem(uint slot, const float scaleValue) | Scales the particle system. |
void SetAlpha(float alphaValue) | Sets the entity alpha (transparency) value. |
void SetAngle(float angle) | Set entity rotation angle in degrees. Vertical entities can't be rotated. ... |
void SetColor(vector3 color) | Set entity color. The default entity color is white ( This... |
void SetEmissiveColor(vector3 color) | Set the entity emissive (self-illumination) color. The default emissive color is black... |
void SetFlipX(bool flip) | Set ... |
void SetFlipY(bool flip) | Set ... |
void SetLayerDepth(float layer) | Sets the layer depth for the entity. If the entity type is not layerable,... |
void SetLightColor(vector3 color) | Sets the child light color if the entity has one. ... |
void SetLightRange(float range) | Set the unscaled light range if the entity has a child light source. ... |
void SetObject(string name, ?&in) | Stores a @reference to an AngelScript object in the entity custom data map. { ... |
void SetParticleBitmap(uint slot, string particleBitmapName) | Sets another particle bitmap to the system at the given |
void SetParticlePosition(uint slot, vector3 pos) | Sets a new relative position to the entity's particle system. |
void SetPivotAdjust(vector2 pivot) | Sets a new pivot adjust position to the entity. Pivot adjust vectors are normally set in the... |
void SetPosition(vector3 pos) | Moves the entity to the point passed as parameter. ... |
void SetPositionX(float value) | Set a new value to the entity x coordinate. ... |
void SetPositionXY(vector2 pos) | Moves the entity to the point passed as parameter. Affects only X and Y axis. The Z position... |
void SetPositionY(float value) | Sets a new value to the entity Y coordinate. ... |
void SetPositionZ(float value) | Sets a new value to the entity Z coordinate. ... |
void SetScale(vector2 scale) | Set an absolute scale value to the entity. Different values to |
void SetShadowZ(const float) | Sets the entity's shadow height (z-position). For a better looking scene the shadow Z-position... |
void SetSoundVolume(float volume) | Set the entity sound volume (from |
void SilenceParticleSystems(bool silence) | Stop all sound effects that the entity might be playing. ... |