Be a Supporter!

_xscale is having problems

  • 180 Views
  • 3 Replies
New Topic Respond to this Topic
GMR516
GMR516
  • Member since: Oct. 11, 2011
  • Offline.
Forum Stats
Member
Level 13
Programmer
_xscale is having problems 2013-01-14 12:47:44 Reply

OK, so I'm making this game, and I have it so that the player flips when you press different directions. It works fine, but when I resize it, (I want to make it bigger) It gets messed up and squished/streched. So, my question is, how would I make the _xscale my CURRENT size, and not it's original.

Thanks in advance.


Don't click me. Please.
^ DON'T CLICK IT.
^ DON'T LISTEN TO THAT.

Max-Vador
Max-Vador
  • Member since: Nov. 12, 2005
  • Offline.
Forum Stats
Member
Level 13
Animator
Response to _xscale is having problems 2013-01-14 12:51:51 Reply

Thanks in advance.
if(
blah blah blah;
){
 _xScale* (-1);
blah
}
tenentenen
tenentenen
  • Member since: Apr. 13, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to _xscale is having problems 2013-01-14 12:54:38 Reply

At 1/14/13 12:47 PM, GMR516 wrote: OK, so I'm making this game, and I have it so that the player flips when you press different directions. It works fine, but when I resize it, (I want to make it bigger) It gets messed up and squished/streched. So, my question is, how would I make the _xscale my CURRENT size, and not it's original.

Thanks in advance.

Very poorly worded, but I think I can see what you are saying.
So like for each of your directions, left/right, you have a line simmilar to:

whatever._xscale = 100;
//or
whatever._xscale = -100;

But you are scaling it up at some point before this so that you can have a bigger sprite.
so you want to swap directions relative to the current _xscale.
do just multiply it by -1 to swap directions.

whatever._xscale = whatever._xscale * -1
GMR516
GMR516
  • Member since: Oct. 11, 2011
  • Offline.
Forum Stats
Member
Level 13
Programmer
Response to _xscale is having problems 2013-01-14 13:11:55 Reply

Thanks man.


Don't click me. Please.
^ DON'T CLICK IT.
^ DON'T LISTEN TO THAT.