Global Sprites on Global Layer

Bugs will be moved here once resolved.

Post » Sat Feb 28, 2015 12:03 am

Problem Description
When I have global sprites on a global layer, travelling between layouts duplicates the sprites and destroys any information they contain.

Description of Capx
There are 4 global square sprites on the top layer. You can click on them to make them change color and increment their instance variable. There is a button on the main layer that takes you to the other layout. Note that when the button is pressed, the layout changes, but the squares

Steps to Reproduce Bug
  • Start the project in debug mode.
  • Click the little squares to make them change color.
  • Click the button to change layouts


    Observed Result
  • Notice that all the squares, which are global, have reverted to thier initial state of being green.
  • Notice that the Instance variable, which has been counting clicks, has reverted to 0
  • Notice that there are now 8 squares instead of 4, and that each pair has duplicate UID

Expected Result
I am expecting each UI element to be created if it doesn't already exist. If it does already exist, I expect it to keep it's state and instance data.
I was expecting each of the 4 little squares to retain it's color and instance variable as the layout changes.

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

Operating System and Service Pack
Windows 7, SP1

Construct 2 Version ID
Release 198, 64 bit.
You do not have the required permissions to view the files attached to this post.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Mon Mar 02, 2015 4:59 pm

Any luck reproducing? or have I misunderstood the intended behavior?
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Mon Mar 09, 2015 11:59 am

It's not a bug that it creates new instances. Since you are using a global layer, it's like copying and pasting that layer's contents to the other layouts. Therefore it's like having another 4 global instances on the second layout. It is working correctly by creating another 4 instances as it goes to the next layout. It's a bug that they have the same UIDs though - this is fixed for the next beta.
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,742

Post » Mon Mar 09, 2015 2:40 pm

Thanks for the reply. If I check for and delete the new copies (by IID), should the originals retain their data from the previous layout?
Edit: Confirmed that all works as it should. Thank you for all that you do Ashley!
B
14
S
5
G
1
Posts: 189
Reputation: 1,536


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest