Another short devlog, again about UI!
I got around to adding a proper button component to the engine that supports both a hover and click state! Currently I am using it in one of the demos for a button that slows down time to 1/10 speed when clicked.
When I was trying to get this working, I realized I had a pretty major bug with how the scale of the window worked, which was causing issues with mouse inputs not lining up correctly with the engine’s visual output, but after fixing that it works great!
The implementation for usage is also pretty simple with the Phoenix.Button() component just having two optional fields, one for onHoverCallback and one for onClickCallback. Here is an example of an onClickCallback being supplied to a button component:
new Phoenix.Button(() => {
app.args.timescale = (app.args.timescale == 1) ? 0.1 : 1
})
Thanks for reading my boring UI yap again!!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.