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.

Newcomers DBPro Corner / Simple Layers Question

Author
Message
Stygian
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location:
Posted: 20th Feb 2010 06:02
Im mostly working with TEXT IMAGES and SPRITE and I am having trouble understanding the concept of layering them. Is there a parameter that allows me to define a "z" axis in these 2D images?

Basically, im having trouble because aside from the sprites, I'm having to redraw images and text each time I add something new. Whatever I display first, seems to go on the bottom, and then things display on top. But, if I add another picture, or line of text, I have to re-display everything I have previously. I am certain that I am doing things wrong, and was wondering if some one could point me towards some tutorial or something similar. Thanks!
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 20th Feb 2010 17:33
check out the

SET SPRITE PRIORITY Sprite Number, Priority

command

Stygian
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location:
Posted: 21st Feb 2010 06:47
Is there also such a thing as TEXT and IMAGE priority?
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Feb 2010 07:30
Nope, you aren't doing anything wrong. That's the way it works. Objects are displayed consistently in the background, Sprites, Text, and Pasted Images show from back to front in the order the commands are executed.

Stygian
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location:
Posted: 21st Feb 2010 09:23
Thats the thing though. The sprite I use is always in the front, regardless of the order it has been executed in. Text and Images follow the rules that you describe.

The issue is that I draw an image, and then if I want to place text over it, I have to redraw every image again, only with the text. And then I have to do that AGAIN when I want to add another line of text. It ends up being bulky, and I find it very hard to believe that its supposed to be like that.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 21st Feb 2010 14:51 Edited at: 21st Feb 2010 14:56
If you can post a short piece of code showing what you want to do...

Without seeing your code, I'll hazard a guess. You are using sprites, so the program output is in "3D" mode. Thus if you want text and images to stay on the screen, then you have to paste them every frame. You might be doing something like this...



Now, this code may be closer to what you want to do...



I think the key to the second bit of code is the SET SPRITE command. It seems like using this command, even if you just set it to the defaults, changes the behavior of how sprites are displayed. Call it a bug or a quirk.

You still get the sprite on top of everything else, but you can add text and graphics to the screen without having to add them back every cycle.

Login to post a reply

Server time is: 2024-11-23 20:03:00
Your offset time is: 2024-11-23 20:03:00