A few questions regarding the "Global" property

For questions about using Classic.

Post » Tue Feb 01, 2011 8:44 am

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!
B
2
S
1
G
3
Posts: 71
Reputation: 1,142

Post » Tue Feb 01, 2011 9:00 am

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.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Feb 01, 2011 12:47 pm

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?
B
2
S
1
G
3
Posts: 71
Reputation: 1,142


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests