[SOLVED] Anchor behavior stretches sprites

Bugs will be moved here once resolved.

Post » Thu Feb 26, 2015 9:37 am

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

Capx
Anchor Scaling.capx


Description of Capx
Just a few sprites with the anchor behavior.

Image

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
You do not have the required permissions to view the files attached to this post.
Last edited by Valerien on Thu Feb 26, 2015 12:14 pm, edited 1 time in total.
B
79
S
22
G
4
Posts: 311
Reputation: 12,774

Post » Thu Feb 26, 2015 11:44 am

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Thu Feb 26, 2015 12:18 pm

Thanks @Aphrodite ! I actually checked the manual before, but just skimmed through the page. My bad! Sorry for that!
B
79
S
22
G
4
Posts: 311
Reputation: 12,774


Return to Closed bugs

Who is online

Users browsing this forum: worm1 and 7 guests