A few questions regarding the "Global" property

This forum is currently in read-only mode.
  • Hello!

    I am trying to work out exactly how the "Global"-property works, and I have a few questions regarding the feature. What I'd like to know more than anything else is if Global makes objects think that they are in one single persistent frame - that is - will whatever object that is set to be global carry on doing whatever it's doing when a new frame is loaded? Or is this highly individual from object to object?

    In order to clarify, I have a few specific cases I'd like to have answered:

    1) If I have a global XAudio2, MOD or any other audio object, and play a song or sample at the start of a frame, will the song then carry over to the next frame? If so, will the opposite happen if the object in question *isn't* set to be global, and stop playing when a new frame is loaded?

    2) If I download a file using the "Download" object and it's set to be global, will the transfer continue seamlessly without interruption even between frames?

    3) If I have a global sprite and I change one of its private variables, will it carry on to the next frame? If not, why?

    4) If I have a global SpriteFont object and place an instance of it in two different frames, will I have to load a sprite into it in both frames, or will it be enough if I do it in the first frame before transferring to the next one?

    5) What happens if I have a global sprite, and I create multiple instances of it in multiple frames? Will their private variables somehow carry on to the next frame? If so, how?

    I'd really appreciate some answers to these questions. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Global means save that objects state as it was at the end of the previous layouts end.

    So your answer to most of those should be yes, but I personally haven't tested all of them.

    Xaudio works seamlessly, and I'm pretty sure there's no bugs with variables, but I wouldn't recommend trying to carry a download across layouts, as loading the layout might bog down the system.

  • Does that mean I only have to initiate a global SpriteFont object once and that it will retain the settings I choose no matter which frame I place it in, as long as the settings are defined once?

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