How do I make the HUD separate from the game?

Get help using Construct 2

Post » Sat Mar 14, 2015 3:48 pm

I want to make an oldschool game, something with the interface of Tyrian.

Image

This game has an HUD/interface like a solid, stand-alone sidebar (on the right of the screen) and the game itself seems to be in a separate frame.
Is this possible to achieve with Construct 2?

You can make a HUD-layer and give it a Parallax of 0 but that layer sits on top of the game. A player can get underneath that layer and the Scroll To-behaviour calculates from the center of the window-size in stead of the frame making things weird.
B
4
Posts: 4
Reputation: 233

Post » Sat Mar 14, 2015 4:08 pm

why not just add a invisible border on the hud?
or you could just add a condition to the movement like "player x< hud overlay

for the "scroll to" you should do it manualy, then you can say something like scroll to player.y,player.x+X

this is how i made scrolling here: http://fldr.de/roguelike8
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sat Mar 14, 2015 5:39 pm

Put the HUD on a separate layer with the Pin Behavior (and keep Parallax at 0,0), and position it where you want in the view window.

See the attached file for a basic example with a text HUD, and a character on a different layer with scrolling and movement enabled.
You do not have the required permissions to view the files attached to this post.
B
6
Posts: 10
Reputation: 272

Post » Sat Mar 14, 2015 8:22 pm

You don't need the Pin-Behavior - only setting Parallax in the Layer properties to 0,0.
You also can set the Scale rate to 0, if you have any Zoom-Effecs in your game, so the HUD-Layer does not zoom with the rest of the game.
B
21
S
5
G
2
Posts: 181
Reputation: 3,499

Post » Sat Mar 14, 2015 9:01 pm

Thanks Cherico, I didn't realize Pin wasn't necessary. Only been doing this a week...
B
6
Posts: 10
Reputation: 272

Post » Sun Mar 15, 2015 1:57 pm

Thanks for the replies, but i already gave that option in the question.

Seems there is no other way then to put an invisible border on the game-layer so a player can't get underneath the HUD and control the scrolling-behaviour with some kind of offset to compensate for the smaller screen.
B
4
Posts: 4
Reputation: 233

Post » Sun Mar 15, 2015 4:24 pm

whats wrong with that solution?
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sun Mar 15, 2015 5:04 pm

There's nothing wrong with it, it just requires a lot of extra hacking to get things right. I was hoping for a solution that gave me a real viewport in which the game runs and things like the scroll-to behaviour would take that viewport as it's center.
More like a screen in a screen.
B
4
Posts: 4
Reputation: 233

Post » Sun Mar 15, 2015 5:10 pm

Sorry, i did not read (understand) the whole question - english is not my motherlanguage ;)
Yes, you only can make an invisible border, so the player can not "fly underneath the HUD".
You can solve the center-scroll-problem, when you calculate for example: scroll to LayoutWidth / 2 - (HUD-Element.Width)
So the center-point is the half of the layout width minus the half of the width of the HUD-Element (width of the graphic).

Sorry for my english and i hope, you understand what i mean and it could help :)
B
21
S
5
G
2
Posts: 181
Reputation: 3,499

Post » Sun Mar 15, 2015 5:20 pm

Yes, both thanks for your answers @Cherico and @fldr.
B
4
Posts: 4
Reputation: 233

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet, plinkie, stevecameron and 1 guest