API reference for GUI font resource

I think there’s a small mistake in the API reference for GUI font resource, in that the property uses resource.atlas when it should be resource.font.

Furthermore, and I think this applies to the two other properties in this section, I believe the names used are a bit too generic and therefore make it more confusing than it needs to be.

Here is the example:

go.property("my_font", resource.font("/font.font"))
function init(self)
  go.set("#gui", "fonts", self.my_font, {key = "my_font"})
end

My main complaint is that the property/self variable (my_font) is the same as the key (which through experimentation, I believe is the name of the font component (? not sure what this is called actually) in the GUI properties panel.

Something like this would have made it faster for me to understand:

go.property("my_font", resource.font("/times_new_roman.font"))
function init(self)
  go.set("#gui", "fonts", self.my_font, {key = "headline"})
end

I’m aware though that the API reference is supposed to be super condensed and clean. So if that’s too messy a change, then just a line explaining what key is would be helpful (currently it just says “Key must be specified in options table.”).

2 Likes

Good point. I have a PR with improved documentation here:

2 Likes