Windows Image size issue IN gameplay (ISSUE FIXED)

DTheChemist

Member
To bring this sprite to a bigger size do i have to use some sort of code? Or is it a sprite issue i have resize manually?

my 8 Bit sprites are at 32 X 32 almost but my GMS2 default size scale is 1 for the XY

 

DTheChemist

Member
i did try to use that. it was pointless to share it here because it was a poor attempt.

image_xscale= 1;
image_yscale= 1;

&

image_xscale += 0.1
image_yscale += 0.1


im getting nothing from it. either my character super scale blows up or it stops him from turning around to walk left. im looking for a clear answer. ive been at this for a half hour now. Docs aint helping me to Resize the character in game. Not enough info for specific things like that atleast im not seeing. thats why i asked here^^

anyway ill wait on another reply here that helps while i look for more answers to this. Im not great at GMS2 just yet.
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
If you are using the image_xscale to reverse the sprite when going left/right (image_xscale = 1 for right, image_xscale = -1 for left), then you will need to modify the code to correct this using a different scale value if you want to draw the sprite at a larger size. So, to start with, you need to decide what size you want the character to be and then set a scale variable to that, then use that variable in the code that moves the character. For example:

GML:
// CREATE EVENT
scale = 2; // make the character twice as big
image_xscale = scale;
image_yscale = scale;

// STEP EVENT
//Movement code for RIGHT here
image_xscale = scale;
//Movement code for LEFT here
image_xscale = scale * -1;
 

DTheChemist

Member
half way there... This is my animation code. your suggestion to enlarge it works to enlarge it decent but it makes him moon walk backwards now. im a bit confused because of what i followed to use first with my hsp and xscale. i was following a step by step tutorial originally. my animation and scaling code section here

//Animation
GML:
//Animation
if (!place_meeting(x,y+1,OGround))
{
    sprite_index =SJumping;
    image_speed = 0;
    if (vsp > 0) image_index = 1; else image_index = 0;
}
else
{
    image_speed = 1;
    if (hsp == 0)
    {
        sprite_index = SPlayer;
    }
    else
    {
        sprite_index = SWalk;
    }
}
    if (hsp !=0) image_xscale = sign(hsp);
    if (hsp != 0) image_xscale = sign(hsp) *abs(image_xscale)
I put your other code here at the bottom where i had my other failed scale codes. while the other is in my variable event
image_xscale = scale;
image_xscale = scale * -1;

video result.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Ah, okay, you need to modify the code slightly then... So:

GML:
if (hsp !=0) image_xscale = scale * sign(hsp);
That should be all you need. Just make sure to set the "scale" variable in the Create Event to what you want for the sprite. And you only need the "hsp != 0" check once. :)
 

TheouAegis

Member
You shouldn't need to be scanning anything. Sprites and text should all be the same resolution as your tiles. The only thing that should be getting scaled-up is the application surface, which GM handles itself. So either you scaled your ground up, or you scaled the player down. You don't want to do either of those. If the line

if hsp!=0 {image_xacale = sign(hsp);}

Doesn't work, then you are manually scaling your Sprites in the room editor most likely.
 

DTheChemist

Member
Ah, okay, you need to modify the code slightly then... So:

GML:
if (hsp !=0) image_xscale = scale * sign(hsp);
That should be all you need. Just make sure to set the "scale" variable in the Create Event to what you want for the sprite. And you only need the "hsp != 0" check once. :)
Thanks! it fixed the issue! šŸ‘šŸ˜
 
Top