Smooth scale on pinned objects

0 favourites
  • 4 posts
From the Asset Store
Wall Pin Board is a hyper causal game developed for fun and inspired by YouTube video whose link is given in description
  • Helloe,

    I got few things that I've been wondering lately.

    I have row of cards and I wanted to implement a smooth zoom effect for them, the kind that when you hover your mouse over a card it scales that card up a bit.

    That's not really a problem, it wasn't hard to implement. The problem is that card is actually a composition of 3 objects (base, image and text). The image and text are pinned with pin behavior to certain image points in the card base.

    Now due this I have to unpin them (pinned objects don't seem to move with scaling), scale them separately and set their position every tick card is scaled.

    All of this seems a bit wasteful and overly complex. So here are few questions:

    Scale vs setsize, which should I use or is there any difference?

    Text scaling, is there a decent way to scale text up? Setsize for text object seems to enlarge the area but not the text itself.

    And more general question about performance: does this kind of scaling that is called every tick give any performance problems? I've tried avoid doing things every tick as much as possible by setting 'run each 0.5 seconds' sort of conditions on events that don't necessarily need that real-time response. Is there really much difference doing run "every tick" vs "every 0.1 seconds"?

    EDIT: Bonus question! I am planning to add a 'pushback' effect as well. when card being scaled overlaps another card next to it, that card should be pushed away so that two cards don't overlap in any situation. The 'is overlapping' just does not seem to work in this case, should it work as a trigger (when card is overlapping a card)or am I doing something wrong again? :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, just wanted to confirm that indeed Pin does not interact with the scaling of the sprite (probably it only does with position and angle).

    I was planing to pin a parent object to a "long bar" sprite and then pin the bar to a child object. Once this was set, I thought I would be able to increase the distance between parent and child only by increasing the length of my long bar sprite.

    No such luck though, going to use trigonometry + the 'update at each frame' method to achieve this.

  • I just ran into this exact issue. :(

    Now I'm going to have to brush up on my math... :P

  • Now due this I have to unpin them (pinned objects don't seem to move with scaling), scale them separately and set their position every tick card is scaled.

    Here are some thoughts on my own question:

    You could set their position to an imagepoint of scaled object every tick the scaling is happening, thus not needing any math for positioning the objects.

    Still, this seems a bit too complex :)

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