How do I make the HUD separate from the game?

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

    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.

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 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.

  • Thanks Cherico, I didn't realize Pin wasn't necessary. Only been doing this a week...

  • 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.

  • whats wrong with that solution?

  • 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.

  • 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

  • Yes, both thanks for your answers Cherico and

  • just came across the same problem a few days ago;

    solved it by making the HUD layer the top most layer and giving it the 'solid' behavior;

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)