How do I prevent global objects regenerated?

Get help using Construct 2

Post » Sun Jan 10, 2016 2:33 pm

When I go to other layout from the first (previewing) layout, the (global layer's) global objects (in this case, they are an information panel's components, which should be only 1 set) regenerates on the new layout and make screen messy, so I made them(the newly generated ones) to be destroyed on the start of every layouts.

But, as this kind of work increase (since there are also other panels, like inventory panel, status panel, etc...) I started to think this is a bit silly, 'cause this means EVERY new layout generates an useless set of components → destroy them, and this must be nothing but a memory-wasting process.

In short......
How can I prevent the useless regenerating of the global objects on start of a layout?
B
13
S
2
Posts: 31
Reputation: 862

Post » Sun Jan 10, 2016 3:22 pm

Sorry but correct me if I am wrong, but from what I can understand, you are saying that you have a few layouts that use the same event sheet, and it creates objects but you only want it for certain layouts? If this is true, than you can use a check layout, for example, if on the layout that you want, than only create the objects you want.
B
45
S
22
G
31
Posts: 686
Reputation: 20,498

Post » Tue Jan 12, 2016 11:54 am

rekjl wrote:Sorry but correct me if I am wrong, but from what I can understand, you are saying that you have a few layouts that use the same event sheet, and it creates objects but you only want it for certain layouts? If this is true, than you can use a check layout, for example, if on the layout that you want, than only create the objects you want.

um... Yes I think your description is correct, but check layout... you mean using LayoutName on condition or something? Even if I use that for condition, the creation of the objects are not by my command, they just appear automatically on the start of new layout (as they are global objects on global layer) so all I can do is just destroying them. So I'm wondering if I can make them not appear automatically...
B
13
S
2
Posts: 31
Reputation: 862

Post » Tue Jan 12, 2016 12:26 pm

I solved the problem! I mean I could fix the messy screen by unwanted generation of the objects(=the panel components.)
The layers should be global so I couldn't change that, but by setting the objects (=the components of the information panel) not global (=let them to be destroyed on every layout ends, and let them to be generated newly on every layout starts), and applying the size or position or content of the components after the new generation(=on the start of every layout,) now there's no more unwanted duplication of the objects, and there's only 1 information panel, looks great.
Hope this could help anyone in similar problem!
B
13
S
2
Posts: 31
Reputation: 862


Return to How do I....?

Who is online

Users browsing this forum: Rhindon and 17 guests