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 / flip and mirror image

Author
Message
Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 22nd Aug 2008 09:02
making a little over head map using tiles made in ms paint. theres no problem but i'm lazy and looking for a quicker way.

you have water, then boom, you have land. unless you have a tile for coast. thing is (where the lazy part comes in) i'v had to make a tile for water to Coast going north to south, w2c-S2N, w2c-W2E, w2c-E2W. and i'm not done yet, there's also corners! with the coast in the NE, cn-NW, cn-...you get the idea.

i know there's a command to mirrow and flip bitmaps, but what about images i'v loaded? unless i messed up (very possible) 'flip image' does work, and 'flip bitmap' followed by the image number isn't does do so well either. go figure.

also, if there is a command to pull this off, how would i set up the for/next loop that is pasting the images? would i nest more loops in the first two (x,y of map) to paste the image where i need the w2c tiles or would i be better off making seprate loops?

this was the only thing search turned up, it looks helpful, but i don't understand it.

http://forum.thegamecreators.com/?m=forum_view&t=67515&b=1

would this do what i'm trying to do, and if so, could any one explain it?

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, because then, there is no tomorrow
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Aug 2008 23:39
You can flip and mirror sprites, and that code makes use of that.

What it does is to make a sprite from the image you specify, flip/mirror it as requested, then paste the finished sprite to the current bitmap. The sprite is deleted (it's only purpose was to flip/mirror), then the image is deleted and recreated from the flipped/mirrored image on the bitmap.

Here's an alternative. If your map contains the image number, a flip/mirror status, and rotation, you can make a sprite using the image, flip/mirror/rotate the sprite, paste it into the correct position on the screen, then repeat for all other tiles, finally deleting the sprite.

The difference is that using the first method means you have all of those images and their combinations loaded into the video memory all at the same time but you only need to prepare the image one, while the second uses far less video memory used but makes your rendering a little more complex.

Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 23rd Aug 2008 06:43
Quote: "but makes your rendering a little more complex."


alittle? i feel so noobish i think i need to change my shorts. but i'l give it a shot. just please don't be upset with me when i completely screw it up ask for help.

thanks Ian

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, because then, there is no tomorrow
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Aug 2008 16:47
No, really. It doesn't make it much more difficult. In fact, I'll talk you through it.

First, you can set up a single sprite and position it off-screen so you will never see it. Also at this point, you can switch off the backsave because otherwise everything will be cleared to the standard blue backdrop after every sync:


Then whenever you need to paste a new tile to the display, you can flip/mirror/rotate the sprite appropriately and paste it into place using a function like this:


Just use the PasteTile function instead of the PASTE IMAGE command and you're good to go.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 25th Aug 2008 21:09
@IanM: Thats quite clever.

I'm using something similar, but using a hidden sprite for each different map tile image. (there are only about 20 of them in my game)

I'm not sure I was aware of the "set sprite image" command, lol

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 26th Aug 2008 13:28 Edited at: 26th Aug 2008 13:29
sorry for the late reply, things got busy for awhile...still are but oh well, i'm tired of dealing with real life.

thanks again Ian. tried the function once but didn't have time to figure it out. gonna give it another shot now.

Edit: nvm edit. was gonna ask a stupid question. haven't been using sync yet because i'm just putting the map to the screen, no motion or changes. gotta start using sync sooner or later.

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, because then, there is no tomorrow

Login to post a reply

Server time is: 2024-11-25 18:41:50
Your offset time is: 2024-11-25 18:41:50