Hidden feature #9: Inherited Layers

Post your own tutorials, guides and demos.

Post » Sun Apr 12, 2009 3:17 pm

I just found them and I have to say they are awesome. They are great for huds and other things that are on every layout but may change later in the game making process.

Here is how they work. First make a new layout and name the layer something unique (for my example well use "InheritedHUD") then go to your games layout Click on the layer that You want to be your hud and go over to its properties and it says "Inherited Layer" Type in "InheritedHUD" and hit enter. The layer that you made on the other layout should be shown in your hud layer. So if you have a game across multiple layouts and want to make a change to the HUD it will be put through to all the layers it is inherited on Automatically. So you can inherit the HUD on all layouts and it will change Automatically.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sun Apr 12, 2009 3:24 pm

Indeed, I've utilised them before for a HUD, very useful for when you're fiddling constantly with an interface.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Apr 12, 2009 8:50 pm

awesome!
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Mon Apr 13, 2009 3:38 am

I didn't understand all of that... will try it now.

This should go in the wiki though :)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Apr 13, 2009 4:02 am

agreed. and at the time of your posting, it already is :)
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Tue Apr 14, 2009 1:48 am

Is there any specific settings, or tick boxes or anything like that that would cause this not to work?

I've set it up as you have said, but it doesn't show up at runtime, and if i deselect the layout, and then return to the properties, my inherited layers box is empty!
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Apr 14, 2009 12:00 pm

Weow! This is pretty fucking awesome.

So this literally means that you only have to create one layer in your first Layout that has the UI in it and then you just create a layer on top of every other layout which inherits the UI layer from the first layout. No copying instances around or shit, it just works.

Nice one!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Tue Apr 14, 2009 12:23 pm

well, if the objects on the original layer are influenced by events from their respective layout's event sheet, you'd have to include that event sheet in the inheriting layer's layout, too. but that is still rather comfortable :)
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Wed Apr 15, 2009 10:24 pm

I eventually figured it out...but my layout editor started crashing continuously shortly after getting it working, clicking on anything, right clicking, moving the layout around, every layout would crash within 3 clicks. It still ran perfectly when executed though. As soon as i deleted the layout i was inheriting from construct stopped crashing.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Wed Apr 15, 2009 10:30 pm

A crash was fixed where if you didn't open the layout where the inherited layer was before others, it'd crash/infinite loop.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests