Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Action Buttons

in Questions Posts: 2,364

Don’t know if this already exists, or is feasible, but after playing with the camera switch, from front to back and vice versa, I thought it would be nice if you could change the text on the button to reflect that. Since the text on the button is the variable used in the call it would appear not. It could be useful if you had a separate button trigger variable and a button name variable so you could switch ON to OFF etc. What do you think ?

Anyone any ideas to achieve this, other than using sprites and a class for buttons?

Is this worth expanding @Simeon? Are you planning UI revolution in 4 ? Could save some real estate in the parameter window.



  • SimeonSimeon Admin Mod
    Posts: 5,705

    You can use parameter.boolean to get a toggle-like UI (on/off). I agree though, that changing the names on the button text would be useful

    Codea 4 will have a different UI and parameter mechanism

  • Posts: 2,364

    @Simeon - thanks for that, fuelling my interest in 4.

  • dave1707dave1707 Mod
    Posts: 9,441

    @Bri_G Do you have a small example of what you’re doing with camera buttons.

  • Posts: 2,364
    @dave1707 - no, just posted a switcher for front to back cameras in the @Creator27 's thread for switching cameras but he wanted Craft cameras not the built in one's.
  • Posts: 1,292

    @Bri_G if I’m understanding correctly what you’re after, you could have two different functions that set up parameters, one with the button text reading one thing and one with it reading the other. Then in functionA’s button action you could clear the parameters and call functionB.

  • dave1707dave1707 Mod
    Posts: 9,441

    Here’s a way to do a camera action button.

    function setup()
    function parms()
        -- add any other parms here
    function draw()
    function switch()
        front=not front
        if front then
            n="Back Camera"
            n="Front Camera"
Sign In or Register to comment.