• This is a helper build macro for easily building classes with Hash values.

For example we can define a class like this:

@:build(defold.support.PropertyBuilder.build())
class MyProperties {
var position: Vector3;
var speed: Float;
var positionY: Float = "position.y";
}

It will be modified by this macro to this:

class MyProperties {
public static final position(default,never): defold.types.Property<Vector3> = new defold.types.Property("position");
public static final speed(default,never): defold.types.Property<Speed> = new defold.types.Property("speed");
public static final positionY(default,never): defold.types.Property<Float> = new defold.types.Property("position.y");
}

This is useful, because hashes that are used often should be pre-computed and stored for better performance.

Go.get(url, "position.y"); // slow

Go.get(url, MyProperties.positionY); // faster

Static methods

staticbuild():Array<Field>