How do I prevent global objects regenerated?

0 favourites
  • 4 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • 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?

  • 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.

  • 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...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)