Simple newbie query

Blitz3D Forums/Blitz3D Beginners Area/Simple newbie query

Ash33(Posted 2003) [#1]
I want to use this command to print names and hiscores at the centre of the screen.
For hi.Highscore=Each Highscore
Print (hi\name$)+" "+(hi\score)
Next

How is it done?


GfK(Posted 2003) [#2]
Text GraphicsWidth()/2,GraphicsHeight()/2,(hi\name$)+" "+(hi\score),True,True



Ash33(Posted 2003) [#3]
Hi Gfk,

The problem is that when I use this the ten names and hiscores in the array overlap at the centre of the screen.


GfK(Posted 2003) [#4]
StartY% = 200
StepY% = 16

For hi.hiscore = each hiscore
  Text GraphicsWidth()/2,StartY,(hi\name$)+" "+(hi\score),True,True
StartY = StartY + StepY
Next
...and as if to anticipate your next question, the code below will line up the the left and right edges of each position in the high score table (or it should do - typed straight into the replybox, untested):
StartY% = 200
StepY% = 16
NameXPos% = GraphicsWidth()/4
ScoreXPos = GraphicsWidth() - NameXPos

For hi.hiscore = each hiscore
  Text NameXPos,StartY,(hi\name$),False,True
  Text ScoreXPos-StringWidth(str$(hi\score)),StartY,(hi\score),False,True
StartY = StartY + StepY
Next



Ash33(Posted 2003) [#5]
Thanks a lot. It worked!


Ash33(Posted 2003) [#6]
You saved my day Gfk! The second code is the the one I needed! Thanks, again! :)