Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 GUI.CreateButtonFull text on button disappears.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Kyle Biro




PostPosted: Sun Nov 24, 2013 8:19 am   Post subject: GUI.CreateButtonFull text on button disappears.

What is the problem you are having?
When I run my game, the first thing that shows up is one button that says "Start Game [S]" and it doesn't actually show up in the button unless I alt+tab out of the game and go back into the game.


Describe what you have tried to solve this problem
GUI.Refresh, but nothing changed


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
This is the code that handles with the menu (the button that shows up at the start).

Turing:


proc menu
    var startGameButton : int
    startGameButton := GUI.CreateButtonFull (maxx div 2 - 100, maxy div 2, 200, "START GAME  [S]",
        GUI.Quit, 50, 's', true)

    loop
        exit when GUI.ProcessEvent
    end loop

    cls
end menu



Please specify what version of Turing you are using
Turing 4.1
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Sun Nov 24, 2013 2:46 pm   Post subject: Re: GUI.CreateButtonFull text on button disappears.

Seems to work fine for me...

Are you using "offscreenonly" by any chance?
Kyle Biro




PostPosted: Sun Nov 24, 2013 8:26 pm   Post subject: RE:GUI.CreateButtonFull text on button disappears.

Ah, yes, I do have an "offscreenonly" in a different file. Is that what causes the problem?
Dreadnought




PostPosted: Sun Nov 24, 2013 9:38 pm   Post subject: Re: GUI.CreateButtonFull text on button disappears.

Well if your in "offscreenonly" mode, the window won't get updated until you call View.Update (however, alt-tabbing will force an update I think).
Tony




PostPosted: Sun Nov 24, 2013 9:41 pm   Post subject: RE:GUI.CreateButtonFull text on button disappears.

code:

loop
        exit when GUI.ProcessEvent
    end loop

your main loop processes button clicks, but doesn't actually draw anything to the screen, which is typically accomplished with View.Update for the offscreenonly mode (which buffers graphics until the frame is ready).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Kyle Biro




PostPosted: Mon Nov 25, 2013 5:43 am   Post subject: RE:GUI.CreateButtonFull text on button disappears.

Does it matter where the View.Update goes in the code? I put it just above the loop and it seems to work fine.

Nevertheless, thank you everybody.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: