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

Username:   Password: 
 RegisterRegister   
 Buttons for Dummies!
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2, 3, 4, 5  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AsianSensation




PostPosted: Tue Mar 16, 2004 11:37 pm   Post subject: (No subject)

the WidgetModule is the file turing includes which gives you the access to the GUI modules/functions, etc. That's why you have to do import GUI at the beginning. It's kinda like a header file. So basicly, that means you can customize things to suit your taste and use a customized WidgetModule so things worklout nicer, or simply just look nicer. I know someone who personally drew out her own GUI buttons, and if she included that in the widget module and gave it to other people, others will be able to use the buttons she drew.
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Tue Mar 16, 2004 11:54 pm   Post subject: (No subject)

GUI. CreateRadioButton <<<makes a round button for forms...

and here is 10 BITs spencer
recneps




PostPosted: Thu Mar 18, 2004 9:05 pm   Post subject: (No subject)

Thats cool. I didnt know that. and thanks ;D (By the way, where did you get so many bits??lol)
Paul




PostPosted: Thu Mar 18, 2004 9:38 pm   Post subject: (No subject)

He was storing them in the items.
Thuged_Out_G




PostPosted: Fri Mar 19, 2004 2:19 am   Post subject: (No subject)

although its called CreateRadioButton,its not really a button. more a rounded check box. except, with a radiobutton, once you click it, the only way i know of to unclick it, is to click another one(going by radiobuttons on webpages)...it would still work well as a button, but its not quite a button...just to clarify
recneps




PostPosted: Fri Mar 19, 2004 11:27 am   Post subject: (No subject)

Interesting. So theres no need to edit my tutorial to explain round buttons? Wink
the_short1




PostPosted: Fri Mar 26, 2004 7:19 pm   Post subject: (No subject)

yes i was storing.... but meh... i like seing that LARGE number... also .i bough 'black' title effect so nonon would realy see the large numnber.... i saving up for 1500 so i can buy something....

second note...

instead of:

loop
exit when GUI.ProcessEvent
end loop

which sucks cuz it that happens and u havn;t pressed a button yet it will freeze ur program

i find this works TEN times better...

in your active game loop add this:

if GUI.ProcessEvent then
end if

and that works the same as the loop but, does not hang the program if you havn;t clicked on a button yet...

second alternative...

process guibuttonevent
loop
if GUI.ProcessEvent then
end if
end loop
end guibuttoneven

fork guibuttonevent

now it will always try to find a GUI button event and will happen more acurately... (you click on it and it will work in nano second isntead of maybe being delayed)

either way... MUCH better in my opinion.... is this method better in others eyes too??? or is it just me.....


stupid turing references sometimes...
very good for the older basic stuff..... but i think Holtsoft is not putting as much effort into the turing reference as the versions increase (with more functions)... like look at the newer functions... theres a whole lot less documentation and a lot more flaky....but i love the new version how they have more examples tho (and have buttons in help to auto run those)
Hotaru




PostPosted: Thu May 20, 2004 7:29 pm   Post subject: (No subject)

~this tutorial is crap~even the one found on the newer version of turing is way more helpful than this~
~but thanks for this helpful tutorial though~
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Thu May 20, 2004 9:52 pm   Post subject: (No subject)

Hotaru wrote:
~this tutorial is crap~even the one found on the newer version of turing is way more helpful than this~
~but thanks for this helpful tutorial though~


are you stupid? Did God give you 6 as your Intelligence score when he was rolling for your abilities?

Did you just wanted bits? If it's like that, here is some bits.

+ negtive 100 bits

there, you'll be owning some bits.
the_short1




PostPosted: Thu May 20, 2004 9:59 pm   Post subject: (No subject)

i was just goign to post a negative response to that...


but i dont have the mod powers to enforce...
DaVe g




PostPosted: Sun Sep 19, 2004 11:08 am   Post subject: (No subject)

Thanks for the tutorial, I tried to make a ball chooser using buttons for my game, and then it chose colour, and just sat there and never went to the game =(
Malazan




PostPosted: Tue May 10, 2005 9:49 pm   Post subject: (No subject)

Thanks so much for the tutorial. It's been a super help for me and my project Very Happy
adams




PostPosted: Tue May 24, 2005 11:17 am   Post subject: disposing buttons

I know you guys are creating buttons but how do you dispose them. I'm making a program with lots of buttons and 'forward proc' and "body proc' stuff like that etc... heres my program can you help with putting in GUi.Dispose or GUI.Disable or GUI.Hide.

code:
import GUI in "%oot/support/lib/GUI"
setscreen ("graphics:vga")
setscreen ("nocursor")
var pic : int := Pic.FileNew ("soccer_stadium.jpg")
var font1 : int := Font.New ("Arial:50:bold")
var font2 : int := Font.New ("Arial:50:bold")
var font3 : int := Font.New ("Arial:16:bold")
var becknum, beckham : int
becknum := 1
forward proc b1
forward proc b2
forward proc b3
forward proc b4

forward proc right1
forward proc right2
forward proc right3
forward proc right4

forward proc wrong1
forward proc wrong2
forward proc wrong3
forward proc wrong4


%***************question 1**************
%below displays what will appear after a button is selected
body proc wrong1
    cls
    Font.Draw ("Wrong", 0, 50, font2, black)
    b2
end wrong1
body proc right1
    cls
    Font.Draw ("Right", 0, 50, font1, black)
    delay (1250)
    cls
    %omit comments below
    %loop
    %        delay (60)
    %        beckham := Pic.FileNew ("beckham" + intstr (becknum) + ".BMP")
    %        Pic.Draw (beckham, 175, 100, picCopy)
    %        becknum := becknum + 1
    %        exit when becknum = 210
    %    end loop
    b2
end right1

body proc b1
    delay (1250)
    cls
    Pic.Draw (pic, 0, 0, picMerge)
    Font.Draw ("From which country did Soccer originate?", 0, 375, font3, white)
    %buttons below (location and what will be displayed on the button)
    var button1 : int := GUI.CreateButton (100, 100, 20, "France", wrong1)
    var button2 : int := GUI.CreateButton (100, 130, 20, "England", right1)
    var button3 : int := GUI.CreateButton (100, 160, 20, "Spain", wrong1)
    var button4 : int := GUI.CreateButton (100, 190, 20, "Brazil", wrong1)
    var button5 : int := GUI.CreateButton (100, 220, 20, "Italy", wrong1)
    var button6 : int := GUI.CreateButton (100, 250, 20, "Germany", wrong1)
end b1

%**********question 2**********
body proc wrong2
    cls
    Font.Draw ("Wrong", 0, 50, font1, black)
    b3
end wrong2
body proc right2
    cls
    Font.Draw ("Right", 0, 50, font1, black)
    b3
end right2

body proc b2
delay (1250)
    cls
    Pic.Draw (pic, 0, 0, picMerge)
    Font.Draw ("When did the sport become recognized?", 0, 375, font3, white)
    %buttons below (location and what will be displayed on the button)
    var button7 : int := GUI.CreateButton (100, 100, 20, "1894", wrong2)
    var button8 : int := GUI.CreateButton (100, 130, 20, "1855", wrong2)
    var button9 : int := GUI.CreateButton (100, 160, 20, "1848", wrong2)
    var button10 : int := GUI.CreateButton (100, 190, 20, "1877", wrong2)
    var button11 : int := GUI.CreateButton (100, 220, 20, "1863", right2)
    var button12 : int := GUI.CreateButton (100, 250, 20, "1886", wrong2)
end b2

%**********question 3**********
body proc right3
    cls
    Font.Draw ("Right", 0, 50, font1, black)
end right3
body proc wrong3
    cls
    Font.Draw ("Wrong", 0, 50, font1, black)
end wrong3

body proc b3
    delay (1250)
    cls
    Pic.Draw (pic, 0, 0, picMerge)
    Font.Draw ("What country and City does FIFA originate?", 0, 375, font3, white)
    %buttons below (location and what will be displayed on the button)
    var button13 : int := GUI.CreateButton (100, 100, 20, "Paris, France", right3)
    var button14 : int := GUI.CreateButton (100, 130, 20, "London, England", wrong3)
    var button15 : int := GUI.CreateButton (100, 160, 20, "Toronto, Canada", wrong3)
    var button16 : int := GUI.CreateButton (100, 190, 20, "Budapest, Hungary", wrong3)
    var button17 : int := GUI.CreateButton (100, 220, 20, "New York, United States", wrong3)
    var button18 : int := GUI.CreateButton (100, 250, 20, "Berlin, Germany", wrong3)
end b3

%*********question 4**********
body proc right4
    cls
    Font.Draw ("Right", 0, 50, font1, black)
end right4
body proc wrong4
    cls
    Font.Draw ("Wrong", 0, 50, font1, black)
end wrong4

body proc b4
    delay (1250)
    cls
    Pic.Draw (pic, 0, 0, picMerge)
    Font.Draw ("Where did the first Olympic Soccer Tournament take place?", 0, 375, font3, white)
    %buttons below (location and what will be displayed on the button)
    var button19 : int := GUI.CreateButton (100, 100, 20, "Poland", wrong4)
    var button20 : int := GUI.CreateButton (100, 130, 20, "Scotland", wrong4)
    var button21 : int := GUI.CreateButton (100, 160, 20, "England", wrong4)
    var button22 : int := GUI.CreateButton (100, 190, 20, "Portugal", right4)
    var button23 : int := GUI.CreateButton (100, 220, 20, "Brazil", right4)
    var button24 : int := GUI.CreateButton (100, 250, 20, "Spain", wrong4)
end b4

b1
loop
    exit when GUI.ProcessEvent
end loop

TokenHerbz




PostPosted: Thu Aug 25, 2005 8:11 pm   Post subject: (No subject)

ok well, i didn't understand anything besodes the 1st post...

And that dosn't explain the fillbutton.

Anyways...

i just wanted to say that your custom circle button dosn't work when u click the right side of it, only the left, or it appears that way on my comp anyways.

I will practice with GUI, but is it possible to Change the TEXT of the buton, when it is clicked?
jrblast




PostPosted: Thu Dec 08, 2005 6:37 pm   Post subject: (No subject)

TokenHerbz wrote:
ok well, i didn't understand anything besodes the 1st post...

And that dosn't explain the fillbutton.

Anyways...

i just wanted to say that your custom circle button dosn't work when u click the right side of it, only the left, or it appears that way on my comp anyways.

I will practice with GUI, but is it possible to Change the TEXT of the buton, when it is clicked?


perhaps just create a new button over it? and stop making that one?

what if i want to execute other functions after the buttons? in my proggy the proc executes, but it doesnt continue after the loop :S
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 5  [ 65 Posts ]
Goto page Previous  1, 2, 3, 4, 5  Next
Jump to:   


Style:  
Search: