defold / defold

Defold is a completely free to use game engine for development of desktop, mobile and web games.
https://www.defold.com
Other
4.43k stars 313 forks source link

Message wrappers for component enable/disable (DEF-3343) #3399

Open britzl opened 5 years ago

britzl commented 5 years ago

GameObject go.enable(url) go.enable(url)

Collection Proxy collectionproxy.enable(url) collectionproxy.disable(url)

Physics collision.enable(url) physics.enable(url)? collision.disable(url) physics.disable(url)?

GUI gui.enable(url) gui.disable(url)

Label label.enable(url) label.disable(url)

Model model.enable(url) model.disable(url)

Spine spine.enable(url) spine.disable(url)

Sprite sprite.enable(url) sprite.disable(url)

Tilemap tilemap.enable(url) tilemap.disable(url)

Part of DEF-1081

Design: (LINK REMOVED)

britzl commented 3 years ago

It should probably be:

go.enable(url)
go.disable(url)
VowSoftware commented 1 month ago

@britzl Do you think it would be better to have just go.enable(url) and go.disable(url), or also have the same for every component type? Also thinking that if url is nil, then all components that are immediate children should be affected, similar to how it works if msg.post(id, "enable" / "disable") is used.

britzl commented 1 month ago

Do you think it would be better to have just go.enable(url) and go.disable(url), or also have the same for every component type?

I think we'd only want go.enable(url) and go.disable(url) and not component specific functions. And it would basically only be a wrapper around msg.post().