Generate structs for use in GameMaker
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
GMStructGUI
generator
gradle/wrapper
LICENSE
README.md
build.gradle
gmlVarNames.txt
gradlew
gradlew.bat
settings.gradle

README.md

gmstruct

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/

Example struct definition file

struct foo {
  x,
  y,
  n = 0
}

struct bar : foo {
  size
}

Using generated source

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
}

#Name Spaces

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