Scale an object smoothly

This forum is currently in read-only mode.
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • Hi,

    I'm trying to think of a way to scale an object smoothly so that it appears as if it is getting closer to the screen.

    I need it to appear as if its rushing toward the player. Any ideas? Point me to the tutorial for that kinda thing?

    Thanks for the help!

  • have you tried set z elevation to current z elevation +1 every tick?

  • Another thing you can do If you want to control zoom is use TimeDelta. Right at this moment as I type, I'm working on something using it for zooming objects in and out.

    The code looks like this:

    Event _____________________Action

    Key Up arrow is down >>>>>>>System: Set Zoom to (ZoomX + 1000 * TimeDelta, ZoomY + 1000 * TimeDelta)

    Event _____________________Action

    Key Down arrow is down >>>>>System: Set Zoom to (ZoomX - 5000 * TimeDelta, ZoomY - 5000 * TimeDelta)

    It moves very smoothly.

  • Ok, I tried zoom, but it scales the WHOLE SCREEN, I just need 1 sprite to appear to rush as the player. So unless I'm wrong about how to use it, it wont work, but ZElevation...

    AWESOME!

    That appears that it would work.

    Can you give me a pointer on how to go about adding 1 to the variable vrs setting it to a specific number. As of right now I only know how to set to a specific setting to a specific integer. Any idea how to go about adding to it.

    Thanks.

    P.S. I might be posting a lot of newb questions on here in the next couple weeks, I am totally drowning over my head here but I'm determined to figure this out.

  • These will do by dimensions:

    Sine behavior

    Scale behavior

    Or

    The expression lerp

    lerp(sprite.z,sprite.z+ target, someting*timedelta)

    Oh Davo,

    Wanna put a z on sine?

  • I totally appreciate the help but I don't see a "scale" behavior.

    I've thought to use the Sine Behavior, but it seems like overkill when all I need to do is "scroll" the scale from small to large.

    I figured there would be a simple line to do that.

    Also, I'm afraid I dont understand where I should be using the "lerp" expression. should I be applying that to the ZElevation Event or?

    Again, seriously thanks everybody. Keep it coming.

  • SCALE BEHAVIOR

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • SCALE BEHAVIOR

    PERFECT! Exactly what I need.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)