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

Username:   Password: 
 RegisterRegister   
 Help with GUI title screen
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jonny Tight Lips




PostPosted: Sat Oct 16, 2004 9:51 pm   Post subject: Help with GUI title screen

My code
code:

setscreen ("offscreenonly,nobuttonbar,position:truemiddle,centre,graphics:640;640")
colorback(7) % Black
cls

var clr : int := 218 % The color to assign to
var text1 : int := Font.New ("Times New Roman:32:Bold") % First Font
var text2 : int := Font.New ("Arial:72:Bold")

procedure newgame

end newgame

procedure loadgame


end loadgame

procedure options

end options

fork intromusic
fork introfx
for decreasing i : 39 .. 0
    RGB.SetColor (clr, 0, 0, i / 39)
    Font.Draw ("The War...", (maxx div 2) - (Font.Width ("The War...", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
    delay (50)
end for
fork introfx
for decreasing i : 39 .. 0
    RGB.SetColor (clr, 0, 0, i / 39)
    Font.Draw ("Has Begun!", (maxx div 2) - (Font.Width ("Has Begun!", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
   
    delay (50)
end for
Font.Draw ("James's", (maxx div 3) - (Font.Width ("James's", text2) div 2), (maxy div 4*3) - 9, text2, red)
Font.Draw ("Games", (maxx div 2) - (Font.Width ("Game", text2) div 2), (maxy div 2) - 9, text2, red)
var newgameb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 40, 20, "New Game", newgame)
var loadgameb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 70, 20, "Load Game", loadgame)
var optionsb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 100, 20, "Options", options)
View.Update
loop
exit when GUI.ProcessEvent
end loop

soundoff := true
Music.PlayFileStop
cls


Ok. First of all the GUI is not working at all. The buttens wont go down or anything and it just stop but still continues playing the music (music is in other file)

Second when I just striped it down to the gui it keeped going in a continues loop and would never end?
code:

import GUI
var text2 : int := Font.New ("Arial:72:Bold")
procedure newgame
put "hi"
end newgame

procedure loadgame

put "hello"
end loadgame

procedure options
put "wow"
end options

Font.Draw ("James's", (maxx div 3) - (Font.Width ("James's", text2) div 2), (maxy div 4*3) - 9, text2, red)
Font.Draw ("Games", (maxx div 2) - (Font.Width ("Game", text2) div 2), (maxy div 2) - 9, text2, red)
var newgameb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 40, 20, "New Game", newgame)
var loadgameb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 70, 20, "Load Game", loadgame)
var optionsb : int := GUI.CreateButton(maxx div 2-100, maxy div 2 - 100, 20, "Options", options)

loop
exit when GUI.ProcessEvent
end loop
put "the end"


Hope you can help. And sorry if I put to much code in this post Confused
Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: