Sine + Negative Width

Bugs will be moved here once resolved.

Post » Thu Oct 18, 2012 12:35 pm

Hi,

When dynamically assigning a negative width/height to an object with the sine behaviour, followed by activated the sine, the negative value resets to the default width/height.



CAPX

Thanks!
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Mon Oct 22, 2012 2:49 pm

I'm not sure this counts as a bug: the Sine behavior uses the size of the object set in the layout which is positive 128. So it initialises like this:

Create Arrow size 128x128
Initialise Sine behavior, width = 128
Start of layout: set width -128
After 1 second: activate Sine behavior using saved width of 128

I could change it so activating the Sine behavior uses the value at the time of activation, but I feel it's likely this could break existing projects that deactivate and reactivate to "pause" the behavior. So closing as won't fix for now - easy workaround is to set a negative width in the layout view instead of setting on start of layout. Let me know if there's anything else you think should be done about this.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,508

Post » Mon Oct 22, 2012 5:44 pm

Thanks for the detailed reply - it makes sense why it's not a good idea to fix. As some context this was being used in dynamically created GUI (like pause screens and end of level screens) to create a 'continue arrow' and a 'back arrow'. Hence the flipping.

I can simply use a new sprite or recreate the Sine behaviour. Thanks!
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest