All,
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.
@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.
@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.
function setup()
switch()
end
function parms()
parameter.clear()
parameter.action(n,switch)
-- add any other parms here
end
function draw()
background()
sprite(CAMERA,WIDTH/2,HEIGHT/2)
end
function switch()
front=not front
if front then
n="Back Camera"
cameraSource(CAMERA_FRONT)
else
n="Front Camera"
cameraSource(CAMERA_BACK)
end
parms()
end