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 / [LOCKED] Help with sprites

Author
Message
flingor
17
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 22nd Jul 2008 14:31
Hi everyone,

I already have some experience with C++ but I've just begun using Dark GDK. So I wanted to program a simple Noughts & Crosses in 2D. But as I started, I immediately encountered a problem with the background.

My game has a resolution of 700x400 pixel and the background sprites has also the same resolution so it should perfectly fit if I put it in coordinates of X=0 and Y=0. But when I compile it the image is "distorted", stretched to the right and shortened in the bottom.

Here's my code:

------------------------------------

#include "DarkGDK.h"


void DarkGDK(void) {

// sync and fps rate
dbSyncOn();
dbSyncRate(60);

dbSetWindowSize(700,400);
dbSetTextSize(30);
dbShowMouse();

dbLoadImage("graphics/background.png",1);
dbSprite(1,0,0,1);

while(LoopGDK()){

// update the screen
dbSync();
}

return;

}

------------------------------------

As I said, "background.png" has the same exact resolution as the program (700x400 pixels) but it doesn't fit as it should but it is stretched.

Please help
Dark Dragon
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 22nd Jul 2008 16:16
Sorry, i dont know much about GDK, But it Really Should go in that section. Good Luck though.

AM I UGLY OR WHAT??!!
oh and join my PivoT Forum at....http://pivo.proboards104.com
Irojo
18
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 22nd Jul 2008 16:53
Firstly, this post belongs in the dark gdk forums. Secondly, You should use the code button in the top right of your post. All you have to do is highlight your code, then press the button. If you use it correctly then it should look like this:



Best of luck to you.

-Irojo

I urge you to watch the film "Who killed the electric car". Support electric cars! Did you know their used to be more electric cars then gassoline cars?

Login to post a reply

Server time is: 2026-07-06 07:17:32
Your offset time is: 2026-07-06 07:17:32