Howdy, Stranger!

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

Fullscreen no buttons

edited April 2013 in Questions Posts: 372

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.

Tagged:

Comments

  • Posts: 1,255

    Do a three-fingered triple tap on the screen. The buttons should reappear.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    Any way to disable the three button tap so it can't be opened when exported into xCode?

  • Posts: 372

    Thanks it worked

  • Posts: 1,255

    @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.

  • Posts: 2,820

    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.

  • Posts: 7

    Hi,
    you can also use the function :

    close()
    

    It will quit to your code editing page ;)

  • edited May 2013 Posts: 2,054

    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

  • edited May 2013 Posts: 372

    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
    
  • Posts: 2,820

    @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.

  • Posts: 2,054

    @Zoyt what is wrong with @Saurabh 's way? I tried it and it appears to work

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @zoyt What are you using for your exit() function?

  • BriarfoxBriarfox Mod
    edited May 2013 Posts: 1,542

    @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.

  • edited May 2013 Posts: 2,054

    @Briarfox Well I have 12 classes but I don't see anything wrong happening when I use this

  • Posts: 2,820

    There's nothing wrong with it, it just can lead to bad coding skills. Let me extract my scene manager and share it.

  • Posts: 2,054

    OK, thank you

  • edited May 2013 Posts: 2,820

    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!

  • IgnatzIgnatz Mod
    Posts: 5,396

    @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>

  • Posts: 2,820

    @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
  • IgnatzIgnatz Mod
    Posts: 5,396

    @zoyt - yes, I know, $&!?**#% WordPress messes up quotation marks.

    I changed them all to single quotes

  • Posts: 28

    @Zoyt What is the meaning of this line : sID = s.
    I like your idea I was looking for somethng like this. :-)
    Is there a program whith this structure available somewhere?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Dreamdancer - sID=s simply stores s in a variable so we can tell what state we are in

  • Posts: 28

    @Ignatz I was not sure of that. The parameter s is used 2 times in the example . In the setup as type number and in the function changeScene as type character(s). I do not like it ,if you do that in a large program it is very difficult to debug. Can you change it in your tutorial, then you have a "clean" example program and better to understand.

  • Posts: 2,820

    @Dreamdancer - Haha... I didn't catch that. What I'm doing in the setup with the parameter.integer is declaring the local variable name to pass the current number on the slider in the callback function. The version of s that is passed into changeScene() is the name of the scene to change to. A little confusing, sorry.

Sign In or Register to comment.