I have a stupid question whose answer I can’t find.
If I run my code in ‘display mode Fullscreen no buttons’ then how can I return back to my code editing page without closing codea? I couldn’t find any way to do so.
Do a three-fingered triple tap on the screen. The buttons should reappear.
Any way to disable the three button tap so it can’t be opened when exported into xCode?
Thanks it worked
@Briadfox I’ve actually been treating the recording ability as a “hidden feature” of the apps I put out. I mention it on the support page, so that those people who come to the web site get a little nugget of insider info.
I’ve been altering images and the library to make the buttons fit my app… For instance, you can change the save image/video dialog images to match your app.
Hi,
you can also use the function :
close()
It will quit to your code editing page
Does anyone know how you can call the reset function without touching the reset button?
This way, i could have FULLSCREEN_NO_BUTTONS and still be able to reset
I made a function such that when the program is over then if I touch the screen the program will start again like so
Setup()
ProgramOver = false
.
.
.
.
--your code
--if your program is over call return function
function return()
If ProgramOver then
Setup()
end
end
-- and add a touch function where you will make ProgramOver true
function touched(touch)
If ..then --add a condition which happens when your program is over like for a game when lives 0
If touch.state==BEGAN then
ProgramOver = true
end
end
end
@Saurabh - That is not an ideal way to do it. You may create variables outside of the setup() or in functions. I do it by creating classes for scenes that have an initiation, draw, and exiting functions. Then, I have a function to change the scene, and it calls the exit function on the previous scene and calls the initial function for the current screen and starts drawing it. If that’s confusing, I’ll share some code.
@JakAttak Like @Zoyt said, if you create anything outside of setup() it can lead to problems. It will work on the small scale but as you add more classes and your program gets bigger, it will be a problem.
There’s nothing wrong with it, it just can lead to bad coding skills. Let me extract my scene manager and share it.
OK, thank you
Here is the code:
--# Main function setup() parameter.integer("Current scene",1,3,1,function(s) if s == 1 then changeScene("start") elseif s == 2 then changeScene("game") elseif s == 3 then changeScene("gameover") end end) end function draw() background(40, 40, 50) scene:draw() end function changeScene(s) if scene ~= nil then scene:exit() end if s == "start" then scene = Start() sID = s elseif s == "game" then scene = Game() sID = s elseif s == "gameover" then scene = GameOver() sID = s else print("Invalid scene name") end end --# Start Start = class() function Start:init() print("start") end function Start:draw() text("Start screen",WIDTH/2,HEIGHT/2) end function Start:exit() print("exit") end --# Game Game = class() function Game:init() print("start") end function Game:draw() text("Game screen",WIDTH/2,HEIGHT/2) end function Game:exit() print("exit") end --# GameOver GameOver = class() function GameOver:init() print("start") end function GameOver:draw() text("Game over screen",WIDTH/2,HEIGHT/2) end function GameOver:exit() print("exit") end ``` Again, there's nothing wrong with your version, I'm just a neat freak, and your method can lead to an incomplete reset of your game. Thanks!
@Zoyt - I hope you don’t mind, I used your code for a tutorial post here
https://coolcodea.wordpress.com/2013/05/04/47-game-template/
with attribution of course =D>
@Ignatz - Great! Thanks. By the way, in this code block, the quotes don’t appear correctly:
function changeScene(s) if scene ~= nil then scene:exit() end if s == "start" then scene = Start() sID = s elseif s == "game" then scene = Game() sID = s elseif s == "gameover" then scene = GameOver() sID = s else print("Invalid scene name") end end ```
@zoyt - yes, I know, $&!?**#% WordPress messes up quotation marks.
I changed them all to single quotes