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 / Paste image in front of sprite

Author
Message
healthyaddiction
22
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 22nd Aug 2009 20:19
In my 2d game that i'm playing with I've got a 2d background using paste image and a sprite character. I also want to have another image that the sprite can actually walk behind (like trees). Using the paste image again will display the image over the ether image but not the sprite. Any way to make the image appear in front of the sprite?

Hope you can help

Thanks

keep the addiction healthy
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 22nd Aug 2009 20:34
Why not use a sprite for the trees?

The image number determines the draw order of sprites since the recent update....or Set Sprite Priority!

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
healthyaddiction
22
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 22nd Aug 2009 21:27
fair play, you're right. Thanks. While i'm at it, is there a way to make a colour other than black be the transparent colour? Other than using a png obviously.

keep the addiction healthy
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 22nd Aug 2009 22:58
Yeah, though I forget the command right now. Something like Set Image Colorkey - only problem is, it is a universal command, so set it before you get the image with the non-black transparent colour, then I think you can set it back to black for others.....unless you plan to use some weird shade of pink as transparent in all your images! ^_^

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
healthyaddiction
22
Years of Service
User Offline
Joined: 20th Sep 2002
Location:
Posted: 23rd Aug 2009 00:09
thanks fellah, worked a treat.

keep the addiction healthy
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Aug 2009 10:42
It's better to HIDE SPRITE and use PASTE SPRITE for your character. That way you can have characters walk behind images and still be able to use the powerful sprite commands.

Order:
<paste background image>
<paste character sprite>
<paste tree images>

Because the trees are pasted last the character will always appear to walk behind it even if it's just an image.

Login to post a reply

Server time is: 2024-09-28 10:33:07
Your offset time is: 2024-09-28 10:33:07