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.

AppGameKit Classic Chat / setspriteimage with distinct image size --> image distorted

Author
Message
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 24th Jul 2012 08:12 Edited at: 24th Jul 2012 08:19
Hi all,
I'm trying to solve a problem I found. I created a sprite with a 256x160 image. If I try setspriteimage command with another image with another size (256x256) the sprite appears distorted in order to fit the new image in the old sprite size.
Anyone knows how I can solve this and how to make sprite takes the new image size?
I'm using setvirtualresolution() to set the screen resolution... I don't know if it matters.

Thanks in advance.

EDIT: forget it... It is fixed using setspritesize(spr,-1,-1)
Sorry, guys.
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 25th Jul 2012 04:34
I seem to recall someone mentioning a problem using the -1 parameters for setspritesize().

If this proves the case, an alternative would be using the values from the image itself, either using the same variable which assigned the image;

or (if the image was assigned some other way such as by a function ) by pulling the image reference from the sprite itself;

Its always good to have a plan B
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 25th Jul 2012 07:32
Thanks for the info, Marl.
Currently it's working fine using -1 parameter but i'll consider your method if using this fails.

Best regards

Login to post a reply

Server time is: 2024-11-23 19:22:44
Your offset time is: 2024-11-23 19:22:44