[SOLVED] Anchor behavior stretches sprites

  • Problem Description

    Sprites with the anchor behavior are being stretched at runtime, depending on the viewport resolution and orientation.

    Capx

    [attachment=0:1n0ivtrs][/attachment:1n0ivtrs]

    Description of Capx

    Just a few sprites with the anchor behavior.

    Steps to Reproduce Bug

    Use the anchor behavior on any sprite

    Observed Result

    Stretching of the sprites + delayed/wobbly update of the sprite position on rescale

    Expected Result

    No scaling

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Win7 sp2

    Construct 2 Version ID

    197

  • left and top edges are positioning relative to the screen, right and bottom edges are scaling relative to the screen.

    https://www.scirra.com/manual/88/anchor

    and If I read correctly (could only explore the capx with a zip and text editor), you are setting right and bottom edges on some of them.

    setting left edge to left will position it relative to the left border of the screen (the left border and left edge will be at the same distance)

    setting left edge to right will position it relative to the right border of the screen

    setting right edge to right will make it stretch to have its right edge at the same relative position to the right border of the screen without touching the left edge

    same logic for top and bottom

    that is why on your screenshot some are placed as intented at the top, continue only using the left and top edge on the bottoms one to have the same result.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Aphrodite ! I actually checked the manual before, but just skimmed through the page. My bad! Sorry for that!

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