Generate structs for GameMaker
Download: https://gmwolf.itch.io/gmstruct
Forum topic: https://forum.yoyogames.com/index.php?threads/gmstruct-struct-generation-for-gamemaker-studio.29731/
struct foo {
x,
y,
n = 0
}
struct bar : foo {
size
}
var foo = new_foo(1,1); //creates a new foo struct
var x = foo_x(foo); //gets a struct attribute
foo_x(foo, 4); //sets a struct attribute
if (is_foo(foo)) { //Checks the type of a struct
//do shomething
}
if (is_a(foo, structs.foo)) { //Also checks a type
//do something also
}
namespace net {
struct foo {
x,
y,
n = 0
}
}
structs are prefixed with their namespace name in GML. Above example will yield a struct named net_foo