• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Does anybody know if draw_sprite_stretched works when drawing to a surface?

M

mariospants

Guest
Can someone please tell me if they know if draw_sprite_stretched works on surfaces? I can't seem to get it to work, and I thought I had before.

Thanks!
 

FrostyCat

Redemption Seeker
Of course draw_sprite_stretched() works on surfaces, as is the case for all drawing functions that allow you to specify a coordinate. You just have to be careful not to draw outside it or use in-room coordinates instead of on-surface coordinates.
 
M

mariospants

Guest
Thanks, but I thought I was being pretty careful... the thing is that surfaces are relative, right? So no matter where it's located, if my x,y for my draw_sprite_stretched is 0,0 and center of the sprite is 0,0, then I should be able to see it, right?

Well, if I do draw_sprite(spr_spritename,0,0,0); the sprite shows up, but if I do draw_sprite_stretched(spr_spritename,0,0,0,sprite_width,sprite_height); it stops showing up.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Are you using literally "sprite_width" and "sprite_height"? Because those reference the sprite assigned to the instance and if it has no sprite then those values are 0... you probably want to use sprite_get_width/height instead.
 
M

mariospants

Guest
Are you using literally "sprite_width" and "sprite_height"? Because those reference the sprite assigned to the instance and if it has no sprite then those values are 0... you probably want to use sprite_get_width/height instead.
Well blow me down and call me Slippy the Frog, but that totally was the problem. Thanks!!
 
M

mariospants

Guest
Just edit the topic title (from the menu at the top right of the post). ;)

Happy to have helped!
Much thanks, that "edit title" link was so small I missed it completely! Now on to masking an animated gradient color logo with my new-found wisdom!
 
Top