ShadowApex / godot-go

Go language bindings for the Godot Engine's GDNative API.
MIT License
363 stars 31 forks source link

Readme example does not compile #37

Closed delaneyj closed 6 years ago

delaneyj commented 6 years ago

The README has basically this as an intro example.

package main

import (
    "github.com/ShadowApex/godot-go/godot"
)

func init() {
    // Register will register the given class constructor with Godot.
    godot.Register(NewSimpleClass)
}

func main() {
}

// SimpleClass is a simple go struct that can be attached to a Godot Node2D object.
type SimpleClass struct {
    godot.Node2D
}

// X_ready is called as soon as the node enters the scene.
func (h *SimpleClass) X_ready() {
    godot.Log.Warning("Hello World!")
}

// NewSimpleClass is a constructor that we can pass to godot.
func NewSimpleClass() godot.Class {
    return &SimpleClass{}
}

However will not compile: undefined: godot.Node2D. The docs appear to be out of date.

ShadowApex commented 6 years ago

I recently merged in a large change that re-implements much of the library functionality, and hadn't yet updated the README.

I updated the README so the steps should compile if you have the latest version of godot-go.

delaneyj commented 6 years ago

Thanks!