2 functions for one button (start / stop)

How would I go about making a button that starts the level (then turns into a stop button), and if the player fails they push the stop button and it restarts the level?

Pretty much exactly the way Bubble Ball has a start and stop button on each level.

Are you using widget.newButton?  Or do you want to build your own?  Do you want a text button or a graphics button?  These all kinda change the equation a bit.

Rob

I’ve been using a button I made myself with a simple graphic and touch function.

However, I just took a game development course that taught how to use button widgets so I would probably want to know how to make it happen with a widget button ;).

If you want to use a graphic button, there is no built in way to swap buttons for different states.  For a text button, you can just change the label.   If you want to use images then this tutorial will likely help you:

https://coronalabs.com/blog/2013/11/26/tutorial-techniques-for-swapping-images/

Rob

Are you using widget.newButton?  Or do you want to build your own?  Do you want a text button or a graphics button?  These all kinda change the equation a bit.

Rob

I’ve been using a button I made myself with a simple graphic and touch function.

However, I just took a game development course that taught how to use button widgets so I would probably want to know how to make it happen with a widget button ;).

If you want to use a graphic button, there is no built in way to swap buttons for different states.  For a text button, you can just change the label.   If you want to use images then this tutorial will likely help you:

https://coronalabs.com/blog/2013/11/26/tutorial-techniques-for-swapping-images/

Rob