Instance

Instance object. Can be created for a render unit as well as for legacy with a programmable model.

Constructors

this
this()
Undocumented in source.

Members

Functions

add
void add(T component)

A method for adding an instance to an instance to expand functionality.

add
void add()

A method for adding an instance to an instance to expand functionality.

cmp
T cmp()

A function that returns a component based on its class.

cmp
Component cmp(string name)

Finds a component by its name.

destroy
void destroy()

Removes an instance. However, not immediately, this will only happen on the next iteration of the game loop for thread safety.

dissconnect
void dissconnect()

Detaches a component from an instance by finding it by class.

dissconnect
void dissconnect(string name)

Detaches a component from an instance by finding it by name.

dissconnectAll
void dissconnectAll()

Detaches absolutely all components in this instance.

getComponents
Component[] getComponents()
Undocumented in source. Be warned that the author may not have intended to support it.
isDestroy
bool isDestroy()
Undocumented in source. Be warned that the author may not have intended to support it.
spriteDraw
Sprite spriteDraw()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_destroy
bool _destroy;

only for call.

active
bool active;

A property indicating whether to handle all events for such an instance. If false, no event will be processed for this instance, however, it will exist. It is necessary if you do not need to delete the instance, but you also do not need to process its events.

components
Component[] components;

Components of an instance, complementing its functionality.

depth
int depth;

The identifier of the layer in which the instance is placed. The render queue is affected, the larger the number, the later the instance will be rendered.

id
size_t id;

Instance identifier (often means storage location in an instances array).

mask
Shape!float mask;

Collision mask. A mask is a kind of geometric shape (or several shapes) that sets the collision boundary between other instances.

name
string name;

The name of the instance, by which you can later identify the collided or other events.

onlyDraw
bool onlyDraw;

A property that indicates whether it is only necessary to draw the object without handling other events in it.

persistent
bool persistent;

A property that indicates whether to transition to a new scene when transferring control to another scene.

position
Vector!float position;

The position of the instance. Serves for collision, rendering, and other instance services.

previous
Vector!float previous;

An auxiliary variable that remembers the position in the previous pass of the game loop.

solid
bool solid;

A property that determines whether an instance can collide with other instances.

sprite
Sprite sprite;

Instance sprite. Will be output at the position of the instance.

tags
string[] tags;

Instance tags. By this parameter, it is possible to distribute an instance about groups, for example, instances that should not let the player in upon collision will be marked with the "solid" tag, but not necessarily only non-living creatures should be used, and others who should not squeeze through are marked with such a tag. (This is an example, there is no such implementation in the framework).

threadid
size_t threadid;

The identifier for the instance in the stream. Shows which thread the instance is running on (changing the property does not affect thread selection).

visible
bool visible;

A property that indicates whether to render the instance and perform rendering functions.

Meta