trying to understand MAGNITUDE

krousty_batkrousty_bat Member Posts: 48
edited November -1 in Working with GS (Mac)
So i'm testing things, and the last one is to put a magnitude(1,2) on the Scale of a square sprite, let's say ,to make it simple, if i touch the screen.

the results I have is a growing and cool slow Grow of my scale, but i'm not sure what it does, is it multiplying between 1 and 2 every frame or second the values of my scale ?

That seems weird for X2 or close values size would be pretty big scale, and everything is smoothly growing I would say, so it's definitely (to me at least) not a simple multipler. Can someone explain me more precicly what is behind a "Magnitude" operation so I can use or re-use it on some other parameters accordingly ?

thx

Comments

  • krousty_batkrousty_bat Member Posts: 48
    of course, I checked this on the wiki first but i'm not sure I get what it does in MY example :P...:

    magnitude

    Usage: magnitude(x,y)

    Find the length of a line segment from the origin, (0,0), to the given point. You can include an offset,(x',y'), to find the length between the two points. i.e. magnitude(x-x',y-y')
    Example: If I wanted to find the length between my actor at coordinates (25,30) and another actor at coordinates (100,240), I would use the expression magnitude(25-100,30-240).
  • krousty_batkrousty_bat Member Posts: 48
    TSB: so I would understand that my scale would get a values between 1 and 2 ?

    to be precise I apply a

    Change Size:
    Growth Rate=magnitude(1,2)

    With "Change size" being an actor with those rules: Grow an actor by a scale factor (shrink by specifying a negative number).
Sign In or Register to comment.