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 / Mandatory Sprite attributes.

Author
Message
SPI
14
Years of Service
User Offline
Joined: 3rd Jun 2010
Location:
Posted: 6th Jun 2010 17:23
Hi there guys,

So I am wondering what kind of attributes a sprite image should have to load successfully.

Last night I tried loading some Mortal Kombat sprites that I got from the following website: http://www.mortalkombatwarehouse.com/

Anyway, I successfully loaded some of the sprites that had a default PNG extension; however the ones with the gif extension wouldn't load at all. I figured the gif format wasn't supported by darkGDK and converted those images to jpg/png but they still wouldn't load.

Could anyone shed some light on the mandatory features a sprite must posses to load successfully? By features I mean the default extension, the background color and other similar attributes. Also how does dark gdk set the Sprites priority? Would sprite a always take priority over sprite b if it were loaded at an earlier point in time?

Thanks in advance.
Poof Master
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location:
Posted: 6th Jun 2010 23:48 Edited at: 6th Jun 2010 23:56
Well this is how I understand it:

1. You are right that gifs are not supported by dark GDK.
2. When loding an image there are two things to remember first where is your image. If you look at the Getting started tutorial you will see that all the images are in the folder Getting started. So to load those images you would put.


Now for instance in my project I have a folder called "Images" where i put everything so my load image looks like this:


3. Next thing to remember when loading an image is what type of image it is: jpg,png etc..
Note: jpg doesn't have alpha so normally stick with png.
4. Now the priority of the sprite doesn't matter with loading the image it comes when you draw the sprite.

So lets say I want to have one big background drawing that will cover my whole screen for the entire game. If you are going to do this then you have to draw that image first. so for example:



Now another way to make sure that the drawing order is the way that you want it to be. Use another function called dbSetSpritePriority ( int iSprite, int iPriority ). If you read the documentation it tells you how it works which is this:

Quote: "This command will set the relative priority of the specified sprite. All sprites start with a value of zero giving them equal chance of being drawn last. By setting a single sprite a value of one will cause that sprite to be drawn last. You can specify a unique priority value for each sprite creating an order of drawing for every sprite in your program. "


Now this post is getting a little long so I will just cut it there but look into the documentation on animated sprites as well because ther are different functions to use like dbCreateAnimatedSprite(). If after looking at the documentation on those and you still have some questions I will be more than happy to help.

Hope this helps.
SPI
14
Years of Service
User Offline
Joined: 3rd Jun 2010
Location:
Posted: 7th Jun 2010 15:03
Right, that was quite insightful. Thanks man.
Pog Mo Hone
14
Years of Service
User Offline
Joined: 21st May 2010
Location:
Posted: 7th Jun 2010 18:08
So what commands determine hiding the background color from a sprite? I cant seem to find that and the sample pictures from Dark GDK are a little weird. Thumbnails have white backs and when opening the pictures theyre black.

"Wisemen say: Forgiveness is divine, but never pay full price for late pizza." - Michaelangelo

Login to post a reply

Server time is: 2024-11-19 23:06:29
Your offset time is: 2024-11-19 23:06:29