GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2016-11-09 08:40:37

gnysek
Member
Registered: 2011-12-29
Posts: 36

instance_on_top

This code returns which instance will be drawn first (valid only for GM:Studio 1.x, and GM5.x-8.x, since in GM:2 we have both layers and dephts (temporary layers))

Expand///instance_on_top(instance1, instance2)
// returns which of two given instances is drawn first

if (argument0.depth == argument1.depth) {
    return min(argument0, argument1);
} else if argument0.depth < argument1.depth {
    return argument0;
}
return argument1;

Offline

Board footer

Powered by FluxBB