Questions regarding buttons without layers
Posted: Fri Aug 09, 2019 9:16 am
As I in my last game tried no layers approach, and I actually liked it, I am now thinking of using it in next one too. However, there are couple of questions regarding buttons that I am still wondering.
When using layers, one of the nice things was that I could attach a button to a layer. When I would move that layer (for example by dragging it with a mouse) so would the button.
Since in no layers approach, it seems to me that i am restricted to using #simplebuttons only, then dragging button around is not so easy anymore. Is there any way to have similar approach to a button without layers, as in having button attached to a layer? Or is my only option that when the button graphics move, I will recreate the button?
Another question is about how is the button order determined in non layer approach.
In layer approach if I had two layers on top of each other, it was usually the top layers button that reacted (although this wasnt officially so, it seems in practice it usually was that way).
As example, if without layers using two simple buttons, first one a large rectangle area, and then the next one smaller, inside that larger rectangle area, then if i click on that smaller area, then which button would be activated, the big or the small one?
Idea in this being that there could be a big box that when you click, you could move it around, and this smaller box would be some button inside this bigger box that is actually meant to be clicked.
When using layers, one of the nice things was that I could attach a button to a layer. When I would move that layer (for example by dragging it with a mouse) so would the button.
Since in no layers approach, it seems to me that i am restricted to using #simplebuttons only, then dragging button around is not so easy anymore. Is there any way to have similar approach to a button without layers, as in having button attached to a layer? Or is my only option that when the button graphics move, I will recreate the button?
Another question is about how is the button order determined in non layer approach.
In layer approach if I had two layers on top of each other, it was usually the top layers button that reacted (although this wasnt officially so, it seems in practice it usually was that way).
As example, if without layers using two simple buttons, first one a large rectangle area, and then the next one smaller, inside that larger rectangle area, then if i click on that smaller area, then which button would be activated, the big or the small one?
Idea in this being that there could be a big box that when you click, you could move it around, and this smaller box would be some button inside this bigger box that is actually meant to be clicked.