Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ok, pretty easy question about displaying a number

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hey, i havent learned this yet, and cant find it but i gotsta know: I am making a pong like game, and it keeps a score. I have a global score variable that keeps track, but i can't figure out how to display it. If you know, please help me out. I would prefer to place a text box in the corner, with the title score(image based) above it. Then it just displays the current total of the global variable score in it. Thanks for your time, it'll be very helpful.
Justin
(BobaFettJ7)
 
First make a field text member called score and on the frame script ( I assumed you will have it stay on one frame) put this handler

on enterFrame
global gScore
put gRight into member("score").line[1]
end

on exitFrame
play the frame
end

gScore being the global of course and score being the name of the field text member displaying the score.

 
I amend that. the frame script should read:

on enterFrame
global gScore
put gScore into member("score").line[1]
end

I used this script myself i just left gRight as the global in the previous post.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top