[R136] Sprite Anchor makes Sprite disappear

  • Link to .capx file (required!):

    CAPX

    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:

    R132

  • Should be fixed in the next build (enabling the Anchor will use its current position instead of its old position).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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

    dropbox.com/s/9qae0dnezi4emr8/anchorBug_by_mouseEvent.capx

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