global objects

For questions about using Classic.

Post » Fri Apr 03, 2009 1:18 am

Hey, I checked around and I couldn't find anything, maybe I overlooked.

Is there anyway to transfer objects from one layout to another? I checked global in the object properties but when I made the new layout the objects didn't transfer over in my objects bar. I can copy and paste, but I was just double checking to make sure I wasn't missing something.

I probably looked over something simple which will end up making me feel stupid haha. Anyway, thanks for the help.
B
11
S
2
G
3
Posts: 23
Reputation: 1,715

Post » Fri Apr 03, 2009 1:57 am

No you didnt miss anything it really does work that way. I never really find having sprites and such set to global a good thing. I usually right click the layout in the layout menu and clone it.

The only stuff I would mark global would be things like mouse and keyboard function object and any object that does not show in the layout. and if you do clone the layout make sure to delete any gobal objects so you dont have two instances running at the same time. so here it is in list form:

Dont make visible objects global.
Clone the layout instead of making a new one.
Delete any global Non-layout stuff from the layout(Mouse and keyboard,Function,etc)

The reason I never have visible object global is because if you go to another layout it will stay in the original layout and you will have two instances going at the same time so its better to keep them not global and just have an instance in every layout.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Fri Apr 03, 2009 5:20 am

thanks for the tip! :D
B
11
S
2
G
3
Posts: 23
Reputation: 1,715

Post » Fri Apr 03, 2009 7:06 am

Or you have one visible global object in the whole game; you can use it in all layouts, however it will only appear on its parent layout's object bar. Well, I have no problem with that, as I typically declare globals on one (starting) layout. No need to clone stuff at all and that way I retain variables (such as character's experience). If you just clone stuff, the clone won't remember anything. :P

Well, that depends on what you use the sprite for! If it doesn't store any information that you are going to need in later layouts, it is fine not to make it global and just copy it into next layout.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Apr 03, 2009 10:18 am

As Aeal stated, the only object's you'll generally want to be global are ones which have a useful function to carry across layouts, like arrays, XAudio2, and soon to be the Online plugin.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Fri Apr 03, 2009 9:47 pm

ah, I was under the impression that being marked as global would make the same objects appear in each object bar, but yeah I think I've got the jist now! Thanks for your help everyone, it's really appreciated! :)
B
11
S
2
G
3
Posts: 23
Reputation: 1,715


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests