Smooth scale on pinned objects

Get help using Construct 2

Post » Sat Dec 01, 2012 8:38 am

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? :)vee412012-12-01 10:11:55
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Jan 23, 2013 9:59 pm

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.Alcemon2013-01-23 22:09:59
B
19
S
4
G
4
Posts: 70
Reputation: 3,896

Post » Fri Feb 22, 2013 7:39 am

I just ran into this exact issue. :(

Now I'm going to have to brush up on my math... :P
B
5
Posts: 19
Reputation: 513

Post » Fri Feb 22, 2013 8:51 am

[QUOTE=vee41]

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.
[/QUOTE]

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 :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests