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.

Dark GDK / [Help] Is there a size or tile format for Create Animated Sprite to process?

Author
Message
Riveira
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 27th Jan 2010 04:26
Hi,

Last night I just started with Dark GDK, I have been playing around with create animated sprite and I encounter a problem:

These are what I did:

1. I started with the default 2D game template (the one with asteroids).
2. I go to google and search for a Charset image and I found a dragon charset with white background and with 4x4 tile but smaller resolution.
3. I set the color type to white (255,255,255), instead of the default asteroid bright pink
4. I change the code:

dbCreateAnimatedSprite(1,"dragon.bmp",4,4,1);

5. I rebuild and run it, the result is I don't have my dragon !!!

6. I know that the asteroid is working, so I took my dragon picture, using mspaint I cut and crop my dragon image one by one and paste it on each of the asteroid.

7. Remove bits and pieces of remaining asteroid picture, put a white background and run the program again.

Amazing, I got my dragon !!!!


My question is, Is there something wrong with my original dragon charset?
It has 4x4 same as the asteroid and I convert it to bmp (i thought png will not work), and it just has different resolution.

How does CreateAnimatedSprite detect the tile size?

All Bug has 100% repro steps
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Jan 2010 20:04
It is more likely that the problem is somewhere in the code, not with the image. I think tile size will be determined by dividing the size of the image with the number of sprites across and down. The png format should work as well as bmp.

I see you used sprite and image ID number 1 in your CreateAnimatedSprite command. If you insert this into the 2D template, that already contains an image whose ID is 1, the backdrop. Maybe the numbers collide. Try to use ID numbers which do not exist elsewhere in the program. If you can't figure out the problem, post the code.

Login to post a reply

Server time is: 2024-11-20 05:23:55
Your offset time is: 2024-11-20 05:23:55