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! / 2D Tilesheet Help

Years of Service
User Offline
Joined: 24th Jul 2012
Location: Hemel Hempstead, England
Posted: 25th Mar 2015 16:17 Edited at: 25th Mar 2015 16:19
Hello to all who have made it to this post, hope you're having a nice day ^_^

Onto the problem:

I am currently in the early stages of a tiled RPG (original I know) and am running into a problem with tile loading and presentation.

I have all the systems in place to load tilesheets from .png's but in order to get each tile individually I am pasting the tilesheet to the screen and using 'Get Image' to grab each tile and saving it in memory.

This worked fine until I started needing to add shadows into my game as when I draw a shadow on my tile (making use of the transparancy so it can be overlapped on something else), it gets pasted onto the black background and now becomes solid rather than transparent when I run the 'Get Image' command.

I used to get around this by just having each tile in a separate .png but realised just how wasteful that got.

Is there a different command that I need to run or am I just doing the entire loading process wrong to achieve the shadows?

I would be grateful if somebody could point me in the correct direction, thanks

TL;DR: Is there a way to have a 'shadow' on a tile and be able to still utilize the transparency even after using a 'Get Image' command.

Edit: Grammar.
Van B
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Mar 2015 10:35 Edited at: 27th Mar 2015 10:35
Well, I'm not 100% sure what the command is, but it lets you set the bitmap format to 21, which enables transparency, so you should be able to grab after pasting and it'll preserve the alpha layer.


I'm not 100% convinced that you need to grab each and every tile though, that seems a bit wasteful and there might be better options for you.

For example, if you make a sprite from the tile sheet, like Create Animated Sprite - then you could set the frame of that sprite to suit the tile number, then paste it directly. This means you'd use that sprite as a brush, pasting onto the screen much like you are now - but with lots of benefits... like rotating tiles, fading tiles, animated tiles. It's the route I'd probably take.

Another option would be to just use sprites for the ground, like make the same sprite as above, but clone it several times to cover the screen, then when scrolling you can reposition the sprites and change the frame numbers to suit the map.

In either case, I think that you should just have shadows as an additional tile layer - rather than having a shadow added onto a tile then grabbed, you could just paste the shadow tile over the top - that way you have much more control and it's far less restricting. I mean you might decide to add in dynamic lighting, so the shadows would all be a separate layer anyway but in this case you'd be doubly glad that you stopped pasting and grabbing the tiles.

I am the one who knocks...
Years of Service
User Offline
Joined: 24th Jul 2012
Location: Hemel Hempstead, England
Posted: 30th Mar 2015 19:18
Thanks for the reply, i'll look into the Bitmap command. I have not really played around with the Bitmaps in DB so maybe they shall show me a new direction I can go.

In terms of sprite animating, I cant really do it like that due to how I am drawing everything at the moment. Also the fact that whilst I have been using DBPro for over five years I have not even touched sprites outside of putting one in and it messing one of my older projects up D:

Fading and rotating tiles is something that I can do with my existing system and the shadows that I will be using are static and have no need for dynamic lighting.

If it is any help I am using the Advanced2D plugin posted here:

Login to post a reply

Server time is: 2024-02-25 01:05:58
Your offset time is: 2024-02-25 01:05:58