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.

DarkBASIC Discussion / 2D DBC Image Help

Author
Message
D a r k
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: In ur fridge, eatin ur foodz.
Posted: 27th Aug 2007 00:22
I'm currently working on a program that lets you place tiles on a grid (its like a map editor in 2D).

I place the tiles as Images, because there needs to be 750 images on the screen at one time (16x16 Tiles, 30x25 grid spaces). I tried using sprites, but when I filled up the entire area the FPS dropped drastically. Now that I use images, The FPS doesn't drop hardly at all even with a full grid of tiles (750+ images). The problem i'm having is with deleting the tiles. When the user wants to remove a tile from the grid, user clicks on the "remove" button and places the cursor on the space with the tile that needs to be removed. Once the user clicks, I find that image, and delete it. The only problem is that when I delete the image, it doesn't disappear until I clear the screen. If I clear the screen, all my pasted images disappear, not just the one that I deleted. How can I get around this?

-I am loading a new image for each tile, this way I can delete the image without effecting the other tiles.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Aug 2007 00:46
I made a similar thing, make a separate bitmap and paste all the tiles you are using onto it (clearing each time it is updated) and then copy the bitmap to screen (or maybe make an image from it is quicker) that seems to work best
Alternatively you could have a "blank" tile and paste that when the player deletes.

Your signature has been erased by a mod because it was rubbish.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Aug 2007 18:33
Just a solid colour would work best I think.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Aug 2007 19:45
yeah that's what I said.

Your signature has been erased by a mod because it was rubbish.

Login to post a reply

Server time is: 2025-05-30 13:44:47
Your offset time is: 2025-05-30 13:44:47