Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing docs on GUI properties and materials #469

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

britzl
Copy link
Contributor

@britzl britzl commented Sep 2, 2024

No description provided.

@britzl britzl requested a review from Jhonnyg September 2, 2024 08:36
@hw762
Copy link

hw762 commented Sep 2, 2024

I get confused by these documentations. Take this as an example:

go.property("mybigfont", resource.font("/assets/mybig.font"))

function init(self)
  local current_font = go.get("#gui", "bigfont")
  go.set("#gui", "bigfont", self.mybigfont)
end

The property declared is mybigfont, but in init it gets and sets a property bigfont, and refers to a self.mybigfont variable which is not mentioned. Is bigfont a built in property? I don't see it listed in the Properties page.

Also, should the property be declared under the gui script of #gui component? Is init function under another component script?

@britzl
Copy link
Contributor Author

britzl commented Sep 2, 2024

I get confused by these documentations. Take this as an example:

go.property("mybigfont", resource.font("/assets/mybig.font"))

function init(self)
  local current_font = go.get("#gui", "bigfont")
  go.set("#gui", "bigfont", self.mybigfont)
end

The property declared is mybigfont, but in init it gets and sets a property bigfont, and refers to a self.mybigfont variable which is not mentioned. Is bigfont a built in property? I don't see it listed in the Properties page.

Also, should the property be declared under the gui script of #gui component? Is init function under another component script?

I've clarified the documentation a bit. The code should be run from a .script component. It makes use of resource properties to define a new resource to set. But in the case of a texture it could just as well be created at runtime using resource.create_atlas(). I've also added images which should hopefully explain it a bit better.

@britzl britzl merged commit 82c9cf1 into master Sep 13, 2024
1 check passed
@britzl britzl deleted the gui-properties-and-materials branch September 13, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants