tida.instance

The module describing the unit of the object - Instance.

An instance is an object in a scene with behavior only for itself with the interaction of other instances, through collisions, any internal events. Each instance has properties of execution conditions, rendering conditions, rendering properties, conditions for the execution of some events. All of these properties describe an instance, however, more behavior can be achieved using inheritance (see tida.localevent). Instance functions are not inherited. but they are directly written and marked with attributes that give execution conditions (under what conditions it is necessary to execute, as if it is a transfer of control between scenes, rendering of a frame, processing user input).

Also, an instance has a hard mask, where, when it touches another mask, a collision event can be generated and such instances can handle this event, if, of course, the corresponding functions have been marked with attributes.

class MyObject : Instance
{
    this() { ... }

    @Init
    void onInitFunction()
    {
        firstProperty = 0.0f;
        position = vecf(32f, 11.5f);
        ...
    }

    @Collision("OtherInstanceName")
    void onCollsion(Instance other)
    {
        other.posiiton -= vecf(1, 0);
    }
}

Members

Classes

Instance
class Instance

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

Templates

debugCollisionMask
template debugCollisionMask(Color!ubyte color = Color!ubyte(255, 0, 0))
Undocumented in source.
isInstance
template isInstance(T)

Checks if an object is an instance.

Meta

Authors

License