[R136] Sprite Anchor makes Sprite disappear

Bugs will be moved here once resolved.

Post » Tue Jun 25, 2013 12:28 am

Link to .capx file (required!):
CAPX
https://www.dropbox.com/s/h8oijg42hqgz8bt/anchorBug.capx

Steps to reproduce:
0. Set the Fullscreen in browser to Crop mode
1. Create Sprite
2. Add an Anchor behavior
3. Try it in the browser - the sprite is not moved
4. Use the Sprite Set X position to ViewportLeft
5. With Anchor disabled, the Sprite moves to the Left, of course without anchoring capability
6. Anchor enabled added - Sprite moves back to its initial position

Observed result:
The Sprite is not anchored to the top-left but at its initial position, even if I change the origin. The Sprite position change is not respected during anchor disabled - on anchor enabled, the sprite is moved back to its initial position.

Expected result:
Sprite 'sticks' to the browser left window side

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

Operating system & service pack:
WinXP SP3
Construct 2 version:
R132XManBG2013-06-26 17:11:10
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Tue Jun 25, 2013 11:42 am

Should be fixed in the next build (enabling the Anchor will use its current position instead of its old position).
Scirra Founder
B
397
S
236
G
88
Posts: 24,412
Reputation: 194,514

Post » Tue Jun 25, 2013 9:07 pm

Thanks for you reply Ashley. I've tested it within the last release from today - R136. It's a pity, but Anchor is still not working as expected. Just load and try my first CAPX.

On Set Anchor disabled, Set X to ViewportLeft and Set Anchor enabled, the Sprite disappears in Chrome and FF, regardless where the Origin is positioned.

On Set Anchor disabled, Set X to e.g. 400 and Set Anchor enabled, it moves the Sprite by default to Layout (not Viewport) top-left position.

I think among the Anchor properties should be added the option to set Left edge and Top edge to 'Reference' (or Right edge, or Bottom edge too) in order for the Anchor to maintain the actual object position only, without moving it to Window top-left again.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Wed Jun 26, 2013 1:07 pm

It's not to do with the anchor behavior, it's because the viewport isn't correct in 'Start of layout'. I think it takes a tick to figure out the window size and update itself accordingly.
Scirra Founder
B
397
S
236
G
88
Posts: 24,412
Reputation: 194,514

Post » Wed Jun 26, 2013 5:00 pm

Ashley, I'm not sure, I have understood your point. I've tried the same Action list on a Mouse Left click event. I perform the click after a while, definitely after the page has fully loaded and initialized - same result: the sprite disappears. Try it your self: On left Mouse click - Anchor disabled and Set X to ViewportLeft. Right Mouse click - just Anchor enabled - Sprite disappears.

CAPX
https://www.dropbox.com/s/9qae0dnezi4emr8/anchorBug_by_mouseEvent.capx
B
11
S
3
G
3
Posts: 79
Reputation: 3,343


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests