Reverting a scaled object back to original size
Posted 25 May 2012 - 11:53 PM
If I have an object that I've scaled down multiple times during a collision even, using image_xscale += -0.1 and image_yscale += -0.1, what do I use to get it back to it's original size.
I've tried setting image_xscale = 1 and image_yscale = 1 which I thought would do the trick but that doesn't seem to work for some reason.
Posted 26 May 2012 - 12:12 AM
donescaling = 0
if donescaling= 0
if image_xscale > .99
donescaling = 1
This makes it grow. - you could also just do:
Edited by ChefDavid22, 26 May 2012 - 01:22 AM.
Posted 26 May 2012 - 04:55 AM
Not the create... he's trying to change the scale of an existing object (or at least that's how it sounds to me) so the create event would be pointless. It needs to go somewhere else... but he said that he has tried that and it doesn't work.
you could also just do:
That being said... no idea why it doesn't work. Either it is working but you're just not seeing it (have you checked it in the debugger?) or it is not working because of some other code that you have. Without knowing your code then I can only make guesses...
- maybe that piece of code is in the wrong location, preventing it from being executed (for example, in an if statement that is never reached)
- maybe you have some code somewhere which is scaling it down again as soon as you reset the scaling
- if you're using a Draw Event... maybe you're accidentally drawing its scale at a value other than Game Maker's built in variable
- maybe you're accidentally reseting the scale on the wrong object
Posted 26 May 2012 - 12:44 PM
Posted 26 May 2012 - 05:09 PM
I think I got this working.
I've been out all day so can't remember what I did to fix it but I don't think there was a problem with image_xscale = 1 and image_yscale = 1, just what I was doing around it maybe.
Cheers for the feedback.
Edited by Freeload, 26 May 2012 - 05:15 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users