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 / Images/Sprite autoscale weirdly?

Author
Message
Serain
18
Years of Service
User Offline
Joined: 17th Jul 2006
Location:
Posted: 3rd Aug 2009 02:16 Edited at: 3rd Aug 2009 02:17
Hello everyone, if anybody can take some time to look at my problem I would really appriciate it! It's so annoying!

My bmp image is a 150x150 pixel square. But when I load it and paste it with this code:

dbLoadImage("EmptyCell.bmp",2);
dbSprite(2,0,0,2); // Empty Cell
dbSizeSprite(2,150,150);
dbHideSprite(2);


dbPasteSprite(2,10,10);

it appears as a rectangle upon execution!!!! Even though I resize the sprite as a square! This is driving me crazy!
Can anyone help me or at least explain why it seems to automaticaly resize an image, and why the explicit call to adjust the size is ignored? Thank you!

EDIT: I'm using a window, not fullscreen, in case it changes anything.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 3rd Aug 2009 02:35
I think maybe you have misunderstood how the dbSizeSprite command works ?

It isnt for "resizing" the sprite, it essentially scales it. Passing a value of 100, means no scaling. So, passing 150, means it will be scaled up 1.5 times. .. So if your sprite image is loaded as a rectangle, then your sprite will be a rectangle.

You could call the dbSizeSprite command, pass a lower value than 100 for whichever side is the longer.. eg :

dbSizeSprite(2, 100, 85);

will leave the sprites x size as it is, but will reduce it's y size to 85% of what it was.

If it ain't broke.... DONT FIX IT !!!
Serain
18
Years of Service
User Offline
Joined: 17th Jul 2006
Location:
Posted: 3rd Aug 2009 10:57
Thank you for the reply! I understand the dbSizeSprite now.
But tweeking with that can't be the only way to make a square bmp actualy look like a square, no? Is there a way to set a sprite to be 150x150 pixels?

I still don't understand why darkGDK wants to resize my bmps all the time! Why can't he just leave them how I made them in MSPaint?
This is so annoying...

Can anyone provide the explanation to this please?
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 3rd Aug 2009 12:05
It doesn't resize them, try exporting them as .PNG


Your signature has been erased by a mod
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 3rd Aug 2009 12:24
Your image size, and the image that you are seeing may be different, which may be causing the problem you describe.

What I mean is that, your actualy "painted image" might be 150x150 pixels, thus a square.. but the image size inside you paint package may be 250x150 pixels, which is the measurement GDK will use, the total size of the image.

If your actual image is a square, then I believe it will load as a square, if you actual image is a rectangle it will load as a rectangle.

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-10-01 08:34:18
Your offset time is: 2024-10-01 08:34:18