Replies: 1 comment 3 replies
-
package main
import "grow.graphics/gd"
import "grow.graphics/gd/gdextension"
type MyEnum int
const (
Value1 MyEnum = iota
Value2
)
type MyClassWithConstants struct {
gd.Class[MyClassWithConstants, gd.Node2D]
}
func (*MyClassWithConstants) OnRegister(godot gd.Context) {
godot.Register(gd.Enum[MyClassWithConstants, MyEnum]{
Name: "MyEnum",
Values: map[string]MyEnum{
"Value1": Value1,
"Value2": Value2,
},
})
}
func main() {
godot, ok := gdextension.Link()
if ok {
gd.Register[MyClassWithConstants](godot)
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Splizard
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
AT
Beta Was this translation helpful? Give feedback.
All reactions