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 Professional Discussion / Sprites come in stretched, is it because of Microsoft Paint?

Author
Message
Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 3rd Sep 2012 04:15 Edited at: 3rd Sep 2012 04:35
Hey guys, I have a question pertaining to sprites in DBPro. I drew something in Microsoft Paint, but when I render it in DBPro using the "sprite" command it seems like it's stretched slightly horizontally. I'm not sure why it does this, but I think it might be something in Paint and not DBPro.

In Paint, the lengths of the sprite on the x and y axes are the same, but in DBPro, it just looks like the sprite is slightly longer on the x axis. Is there any way around this?

EDIT: I just saw in the thread that Lee Bamber posted that somebody already mentioned this bug. It looks like it's a DBPro issue.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 3rd Sep 2012 07:14
Your image is probably scaled to a nearest power of 2, unless you tell Load Image otherwise.

eg, Load MyPicture, into image slot 100, and preserve the original image size

LOAD IMAGE "MyPicture.png", 100, 1

Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 3rd Sep 2012 18:01 Edited at: 3rd Sep 2012 18:01
I include the "1" when I use "get image," and it definitely fixes the image quality, but even when I do set a texture flag, the image is still slightly stretched.

EDIT: Typo.
Virtual Nomad
Moderator
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 3rd Sep 2012 23:45 Edited at: 3rd Sep 2012 23:56
set your app/game to match the monitor's aspect ratio. otherwise, dbpro defaults to 640x480. fit that into most monitors and it'll have to be stretched to fill the screen.

add:

look into the following commands:

DESKTOP WIDTH() & DESKTOP HEIGHT()

SET DISPLAY MODE

and

PERFORM CHECKLIST FOR DISPLAY MODES if you want to use a smaller display/resolution but still maintain a user's aspect ratio.

finally,

if you're playing with window mode, look into IANM's Matrix1 plugins (#13)

Virtual Nomad @ California, USA . DBPro V7.7
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 29th Nov 2012 03:20
Hey guys, I realize I just revived this thread without any real reason, but I forgot to thank you all for your responses. So thanks.

Haven't had a chance to try the suggestions out, but I will let you know the verdict.
Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 29th Nov 2012 03:27
OK, I have to admit, I haven't actually ever used "set display mode" before, and so I have been designing sprites with the idea that the screen is 640x480 pixels. This is an eye-opener, LOL.

Time for bigger sprites.
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 30th Nov 2012 20:00 Edited at: 30th Nov 2012 20:04
Like Nomad said, you can use lower screen resolution and with 'PERFORM CHECKLIST FOR DISPLAY MODES' you can find the right resolutions to use, so you don't loose aspect ratio (width-height will remain the same). So, it's not really necessary to remake stuff. Or you could resize images in code or you could make a windowed game.

Regards Sph!nx
www.mental-image.net

Login to post a reply

Server time is: 2026-07-07 08:10:32
Your offset time is: 2026-07-07 08:10:32