"Set Mirrored/Flipped" changes width/height on runtime

Bugs will be moved here once resolved.

Post » Mon Sep 22, 2014 10:43 am

Problem Description
"Set Mirrored/Flipped" changes sprite width/height on runtime to the negative value, so that if you have some event triggered on Object.Width/Height < Number - this event will be triggered.

Attach a Capx
https://www.dropbox.com/s/90q8qk0bucdowor/mirror_flip_bug.capx?dl=0


Observed Result
Mirrored/Flipped changes dimensions to the negative value: Width*-1 Height*-1
On Width/Height changed events are triggered

Expected Result
Width & Height should not be changed
On Width/Height changed events should not be triggered

Affected Browsers
[list]
[*] Chrome: (YES/NO)

Operating System and Service Pack
Win 7

Construct 2 Version ID
r180 64bit
B
45
S
11
G
4
Posts: 517
Reputation: 7,398

Post » Mon Sep 22, 2014 1:06 pm

Intentional behavior. Not a bug.
Use abs(Object.Width/Height) < Number instead
B
34
S
9
G
3
Posts: 517
Reputation: 5,246

Post » Mon Sep 22, 2014 1:29 pm

This is by design. Mirroring/flipping is implemented by setting a negative size. If you want your events to ignore the mirror/flip state, take the abs() of the size.
Scirra Founder
B
399
S
236
G
89
Posts: 24,535
Reputation: 195,412

Post » Mon Sep 22, 2014 1:44 pm

OK, anyways it's not a big deal if you know it, but what is the purpose of "mirror", if it's basically the same as "set widht to self.width*-1"?
B
45
S
11
G
4
Posts: 517
Reputation: 7,398

Post » Thu Dec 11, 2014 2:27 am

Would it be possible to include this as a note in the manual / in-editor text for both Width and Height? Something like Sprite.Width: Get the object's width, in pixels. This value may be negative if the object is mirrored." May save someone some head-scratching, for example I just now set an object's scale based on a (mirrored) object's width. It came out upside down due to the negative scale.
B
10
S
2
Posts: 33
Reputation: 710


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 7 guests