Align to right Anchor

Bugs will be moved here once resolved.

Post » Fri May 31, 2013 1:40 am

Link to .capx file (required!):
CAPXX

Steps to reproduce:
1. Create 128x128px sprite, put origin at top right(128, 0)
2. Anchor it to the top right
3. Add sine behavior

Observed result:
Object grows to the right

Expected result:
Object grows to the left

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: NA

Operating system & service pack:
xp sp3, win7

Construct 2 version:
    r132
B
18
S
5
G
4
Posts: 568
Reputation: 5,084

Post » Thu Jun 06, 2013 8:25 pm

Also, another related bug:

When aligning both (left and right) anchors to the right
What Happens:
The object squishes.

What should happen:
object should ONLY be allowed ONE align, to left or right, not both.
B
18
S
5
G
4
Posts: 568
Reputation: 5,084

Post » Fri Jun 07, 2013 2:18 pm

Closing as not a bug. The Anchor behavior is working correctly and anchoring the left edge of the object as it has been set. If you do not want this, remake the anchor behavior in events (e.g. using the ViewportRight() expression).
Scirra Founder
B
402
S
238
G
89
Posts: 24,637
Reputation: 196,071

Post » Fri Jun 07, 2013 6:27 pm

Ashely, the Right Anchor is the problem, not the left.
When you set a Right anchor, the object anchors to the left, not to the right. And it doesn't respect the origin point.
B
18
S
5
G
4
Posts: 568
Reputation: 5,084

Post » Fri Jun 07, 2013 6:42 pm

B
18
S
5
G
4
Posts: 568
Reputation: 5,084

Post » Fri Jun 07, 2013 6:45 pm

The object has the Origin set at the Top Right, so, Sine Size should make it grow to the left, correct?

But the opposite happens.
In the export, Sine makes it (wrongly) grow to the right, it doesn't respect two things: the Anchor set to right, and it also doesn't respect the Sine Size growth to the left.

It should grow to the left.

Hope I explained myself.
B
18
S
5
G
4
Posts: 568
Reputation: 5,084

Post » Fri Jun 07, 2013 8:56 pm

Well, the left edge is supposed to maintain the same distance from the left of the viewport, and the right edge is supposed to maintain the same distance from the right of the viewport. The sine behavior changes the size, which conflicts with what the anchor behavior is trying to do. I don't think there's an obvious thing that should happen here, so I'd recommend just using events instead of the anchor behavior.
Scirra Founder
B
402
S
238
G
89
Posts: 24,637
Reputation: 196,071

Post » Fri Jun 07, 2013 11:31 pm

Maybe it'd be good to have in SC2 the priority for these kind of behaviors. i.e. make the origin point have priority over the anchor, or the other way around.
That way they won't conflict, because one will always have 1st priority over the other.
Maybe this will break a couple of things in the next beta for some users, but in the long term it will be easier to maintain, and it'll be easier to spot things like these in debugging, and last but not least, the SC2 users will know what goes first when coding.California2013-06-07 23:36:00
B
18
S
5
G
4
Posts: 568
Reputation: 5,084


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests