Sprite.Width / Sprite.ImageWidth = Width Scale
Sprite.Height / Sprite.ImageHeight = Height Scale
((Sprite.Width / Sprite.ImageWidth)+(Sprite.Height / Sprite.ImageHeight)) / 2 = average scale.
People really need a custom plugin/behaviour for such a basic math logic...?
Not hating on your plugin of course, so don't be offended.
Hi Niespor,
Your math skills are really impressive, but I encourage you to take a closer look at the ACEs of the behavior as it covers much more than what you tried to calculate above.
Your example shows how to calculate the current scale by its image. Which is also covered in the behavior but it's not very useful in the majority of projects.
What's useful is the scale by the initial size of the sprite (not image), which is not covered in C2.
Let's say you want to enlarge the sprite by 10% when you click on it and then revert it back to original size when you release the button. With C2 you'd have to save the original width and height of the sprite to some variables. Then calculate 110% for height and width and then use saved data to revert the size to original... which is quite a lot of work as for such a simple thing.
With Scale behavior you just use one action and set scaleBySelf to 1.1 and then to 1.
There are obviously many more use cases than that.
Thank you for your interest in Scale behavior!