How do I keep same HUD for all levels

Just started using Construct 2? Post your questions here

Post » Mon Apr 28, 2014 4:35 pm

let's assume i'm making a platform game with 50 levels. so i will create 50 different layouts... i have a score and a health bar. do i have to write the event sheets again and again for keeping and displaying score and health? or is it possible to use a seperate event sheet for just keeping score, health etc.
B
3
Posts: 3
Reputation: 181

Post » Mon Apr 28, 2014 4:40 pm

Just make a layer called "Hud" or whatever you want it to be and make sure its the top one, then in the properties window. Set parallax to 0,0 for the layer.

Setting parallax to 0,0 allow you to scroll the screen while always leaving the hud where you have placed it in the design view.

Then all objects that are part of the Hud you make global, by selecting them and in the properties window you set global to true. Whenever you make a new layout you just duplicate this layout or you add a layer and call It "Hud" as well to avoid any unforeseen problems.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Thu May 01, 2014 3:33 am

It's a little tedious to set up at first, but just have an event sheet for your ui that you include on every pertinent layout. Have a single event "On start of layout" and have it create the objects you use in your UI on your UI layer. So you still need to make a layer called UI or something, set it to 0,0 parallax and probably 0 for scaling, so don't forget to make the layer! But you can simply spawn in all of the objects you need and then have all of the events that control the elements in that included event sheet.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Jul 08, 2014 12:31 pm

Yeah in my current project my UI is made up of around a hundred small pieces. What I am trying to do is to put all of them into a family, give the family instance variables of startx, starty and startangle, put them in place by hand on a layout, give the startx and starty values manually, then create them in the beginning of the layout in the correct order to prevent z-sorting related problems. This is not easy and alot of hassle, and also not fun but it's part of the work I guess...

And that's not even counting that I have to manipulate the instance variables for various aspect ratios in-code... We really need a solution here, whether a plugin or an official update...
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Sun Jul 13, 2014 8:52 pm

Three questions:

1. Why 100 small objects, there must be an easier way..
2. Why is the z-ordering important? Would using animationframes work for some of the objects?
2. Would containers work for what you are trying to do?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest