forums

TNT Basic Forums > Programming Q&A
Bug?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-01-2003 23:41

Posted by:
Ashlin Aronin

Click Here to Email Ashlin Aronin   Find more posts by Ashlin Aronin

I don't know if this is a bug or if I'm missing something real obvious. I've been trying to write my character's health to the screen with "draw text" and then "as string(variable". At first the letters overwrote themselves whenever his health changed. I searched past posts on this forum, and found that I could use Fill Rect to solve this problem. That didn't work. I checked Mark Tully's Map Viewport Example and found some text that didn't overwrite itself (the x,y coordinates under the viewpoint). I copied that code into my game, and it worked just fine. When I changed the X and Y coordinates to the ones necessary for my game, it didn't work. I changed them back, and it worked again. Is this a bug?

02-02-2003 16:32

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Are you pasting text on the viewport itself? If so, you should create a second viewport, with the size of the lives bar. If you need more info, reply.

02-02-2003 16:33

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Are you pasting text on the viewport itself? If so, you should create a second viewport, with the size of the lives bar. If you need more info, reply.

02-03-2003 15:09

Posted by:
Ashlin Aronin

Click Here to Email Ashlin Aronin   Find more posts by Ashlin Aronin

Actually, I'm not making a scrolling game or using viewports, I just looked at Mark's example to see how I could stop text from overwriting itself.

02-03-2003 16:10

Posted by:
jamie

Click Here to Email jamie   Find more posts by jamie

draw text

Here is the procedure that I used in penguin power! to just what you are talking about:

Procedure drawtext()

set pen colour make color (0,30,80)
fill rect 0,569 to 800,600

set pen colour make color (255,255,255)

text size 15

draw text 25,590,"level: "+as string(currentlevel+1,0)
draw text 225,590,"lives: "+as string(lives,0)
draw text 405,590,"pack power: "+as string(packpower,0)
draw text 645,590,"score: "+as string(score,0)

end proc

The source is available here www.clay-communications.com/penguinpower if you want to check it out.

02-09-2003 14:15

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

I think the problem is that the DRAW TEXT x-y positions represent the bottom of the text, not the top, so you were erasing over the letters.

02-10-2003 15:10

Posted by:
Ashlin Aronin

Click Here to Email Ashlin Aronin   Find more posts by Ashlin Aronin

Sorry...

Sorry everybody. It was my own stupid mistake. I didn't have the coordinates correct, but I've got 'em right now. Thanks for helping me, though.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.