[Request] Global Instances of an Object

Discussion and feedback on Construct 2

Post » Wed Mar 19, 2014 3:25 pm

It would be cool if you could mark individual instances of an object as global instead of the whole object type. This is practical in instances such as having HUD global spritefonts and then wanting to use the same spritefont for a message box or something but then the global property screws it all up for the localized instance of the spritefont.

Also this is a little off topic but it would be handy if the sprite font could load images from within the game's files.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Wed Mar 19, 2014 3:50 pm

This is practical in instances such as having HUD global spritefonts and then wanting to use the same spritefont for a message box or something but then the global property screws it all up for the localized instance of the spritefont.


actually its more an issue of picking the right text instances, having a variables name="score" tag="hud" can help you here , making a function out of it also helps, or you could simple check if they are on a certain layer, many possibility's..

it would be handy if the sprite font could load images from within the game's files.


yes it would, and maybe having the same ability like sprites to change frames, right now im using a spritefont family to do all my picking, +different spritefontobjects for different styles, having more control over spritefont, is definitly something i would like to see
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Wed Mar 19, 2014 4:11 pm

You can already do this. Non-global objects are simply destroyed at the end of the layout. So make the object type global and at the end of the layout, destroy the ones you don't want to act globally.
Scirra Founder
B
399
S
236
G
89
Posts: 24,523
Reputation: 195,379

Post » Thu Mar 20, 2014 6:25 am

The spritefonts never come back though after destroying them even if you return to the layout they originated from.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Thu Mar 20, 2014 10:13 am

That's because they've been destroyed. Destruction is permanent on global objects, across all layouts. Returning to their originating layout won't recreate those objects because they exist "above" the concept of layouts.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 20 guests