I need change property of sprite to invisible, for a time. I not able to find in documentation.
You can use msg.post("#sprite", “disable”) or go.set("#sprite", “tint”, vmath.vector4(1,1,1,0))
and then when you want it to appear again use:
msg.post("#sprite", “enable”) or go.set("#sprite", “tint”, vmath.vector4(1,1,1,1)) depending on your initial choice
2 Likes
This is the preferred way. A disabled component will have virtually zero impact on performance. Setting alpha to 0 will still result in a lot of computations in the engine.
8 Likes
Has keyword list from learn document? like “disable”.
The API reference shows all of the messages you can send to various components. I also made several changes to the manuals:
- Added a components overview: Game object components
- Split tilemap manual into Tile Source (Defold tile source manual) and Tilemap (Defold tile map manual) manual
- Created a Script manual (Writing game logic in scripts) and moved some content from Lua in Defold (Lua programming in Defold)
- Moved Atlas and Font from Components to Resources in the left-hand menu
3 Likes