Jump to content


Photo

x&yscale..


  • Please log in to reply
3 replies to this topic

#1 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 05 May 2012 - 08:53 PM

this i can never figure out...


i have a sprite with sprW = sprite_get_width(sprite_index)
i want to draw this but exactly 5 pixels bigger using image_xscale and yscale...

Edited by flxp, 05 May 2012 - 09:54 PM.

  • 0

#2 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 05 May 2012 - 09:01 PM

Why can't you you draw it 5 pixels bigger?
or is it for learning?
  • 0

#3 kelson

kelson

    GMC Member

  • GMC Member
  • 303 posts

Posted 05 May 2012 - 09:03 PM

well then what you need to do is

xscale=(5 / sprite_get_width(sprite_index))+1

and if you want the sprite to stay in aspect ratio then you need both the x and y scale to be the equil
  • 0

#4 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 05 May 2012 - 09:54 PM

sorry i wasnt thinking much for this one...
stupid old gradeschool math..

(sprW+5)/sprW


my solution.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users