Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Text overlapping even though sprites refresh

Author
Message
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 5th Jan 2004 22:55
I have a fairly small program at the moment with a few sprites bouncing around the screen not doing a heck of a lot.

The problem is I wanted to see the positions of each sprite as it was moving so I put a couple of lines in to display the x,y coords of sprite, the problem with that is that althought the sprites update and move freely the text just overlays over the top of the old as it updates.

Am I gonna need to cls between every frame/sync? and if I do is this gonna belt up my fps throught the roof?

I would print code but I feel its very irrelivant besides its on the other comp and I don't really want to mess around with discs.

Any help would be appreciated. thx in advance.

Ok so its not a mouse.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Jan 2004 23:25
Try set text opaque. It works with text commands but not print commands.
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 5th Jan 2004 23:34
Um this'll work not quite what I wanted though..

I really wanted the old text to disapear and the new text to apear in the same way that the sprites handle.

For example say I wanted to tag a word or number to something in the future without it stenciling itself on the background image but to still be able to move with the sprite?

Ok so its not a mouse.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 6th Jan 2004 00:22 Edited at: 6th Jan 2004 00:25
Oh you want the text to move around. You could make 10 small sprites with numbers from 0-9. You then convert the x/y coords to a string$ then convert the string to these sprites. Or there's memblock uv mapping, or there's the simple get image command which is supposed to be slow.

Pincho.
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 6th Jan 2004 00:43
Um not exactly. I don't know how to explain myself..bit tounge tied

I have a basic knowledge of programing (enough to program a nice talking sandwich on me old spectrum +2)but I'm still getting used to the commands in DB.

So far I've done bits and pieces using DB mostly 3d stuff getting used to the way the objects orientate with each other camera and matrix stuff nothing too complex.

I thought I'd have a go at playing with some sprites.

In playing with the 3d stuff I got used to putting in something like..
Text screen width()-80,screen height()-30@FPS: @+ STR$(screenfps())
..at the end of the code loop before the sync command.

I've started as I stated before playing with sprites and the problem is this command no longer seems to work in the same way.The text of the numbers just overlays the old text so as the fps changes it becomes a blurred block.

I have a background image with sprites moving randomly over the top.The sprites work fine and act as I would expect them to, redrawing as needed.

Initially I wanted just the info on each sprite printed on the side of the screen with x,y location and a heading. then I was going to tag a label to each sprite as it was drawn showing just its heading.
obviously If I used opaque text you would no longer see the sprite as well as before.

I hope this information helps with my particular problem. I'm gonna take a shower and then check again to hopefully get a solution so I don't dream of this all night long.

Thx again.

Ok so its not a mouse.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 6th Jan 2004 02:23
Just put cls at the top of the loop.
I am not to great with 3d but I think the reason it works in 3d is because the backdrop is drawn each frame and overrights the text.

dbpro : 2ghz p4m : 512mb : geforce 4 4200 go
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 6th Jan 2004 19:37
yeah thats what I thought although I thought bak buffering worked in the 2d realm too.. oh well time to rewrite a bit of code. (just to get the cls in the right place...lol

Or maybe I should just stick in front of the sync command?

would that work?

Ok so its not a mouse.

Login to post a reply

Server time is: 2024-05-12 09:31:32
Your offset time is: 2024-05-12 09:31:32