Skip to content

How should I instantiate a Go struct to return it in a method and then use it on GDScript? #35

Answered by Splizard
pafuent asked this question in Q&A
Discussion options

You must be logged in to vote

@pafuent I have made some changes around gd.Context to hopefully improve the experience here, you can do the following now and I can confirm this works with the latest master:

func (k *Bar) GetBar(message string) Object.Instance {
	var result = new(Bar)
        result.Message = message
        return Object.Instance(result.AsObject())
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@pafuent
Comment options

@pafuent
Comment options

@Splizard
Comment options

Answer selected by Splizard
@TeddyDD
Comment options

@Splizard
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants