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 / Sprite Image Quality Problem

Author
Message
Bipo
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 8th Jun 2009 15:30
Hi everyone, I'm new to the forum. Working on a 2d game in DarkGDK.

I have some nice images for sprites but when I save them as bitmaps (24-bit) the image quality of the sprites in the game is not very good (PNG is fine, but transparency doesn't seem to work so PNG seems suitable only for a solid 'back layer'.)

(When I open the images in MS Paint or GIMP the quality is higher than what I'm getting onscreen in my game (i.e. they look better!)... so it doesn't seem to be the file format!?)

Is dbSetImageColorKey making a range of colors transparent? Any help here would be appreciated!

Thanks.
Bipo
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 8th Jun 2009 16:50
One update then I get one of these babies: !

I've been looking at the Dark Invaders Game (the sample 2D game that comes with DarkGDK). I'm wondering if I'm handling transparency incorrectly... (accounting for the problem above?)

Dark Invaders shows layers of smoke with (apparently) varrying levels of transparency. It's very clean and (contrary to my statement above) uses .PNG format for its sprites.

I've been using dbSetImageColorKey in combo with .bmp files to handle transparency in my 2d game. I can't even find this command in Dark Inavaders. Am I missing something here?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 8th Jun 2009 16:59 Edited at: 8th Jun 2009 16:59
What iFlag value are you using when you load the image?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 8th Jun 2009 22:59
Just use flag 1 when loading images:
dbLoadImage( char* szFilename, int iImage, int iFlag = 1 )
e.g.
dbLoafImage("myimage.bmp", 1, 1);
Bipo
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 9th Jun 2009 05:48
Thank you Lilith & Krisacz. You guys rock. My game looks 8 x better. Crisp, clean. I was only using 2 arguments & I guess the iFlag defaults to 0? Anyway, fixed. It works.

Thanks again.

Login to post a reply

Server time is: 2024-11-05 22:55:44
Your offset time is: 2024-11-05 22:55:44