Moving Hud Relavant to Viewable Screen.

This forum is currently in read-only mode.
0 favourites
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hello again, I had a quick question concerning positioning hud items when it comes to working with scrolling the screen. I am working on adding a timer, lap count, and position count as hud items. The entire layout size is 4200x4200 and the viewable area size is (at the moment) 800x600.

    I have set the the screen to follow the car when the car is moving but I am having trouble figuring out how to get the parameters of the viewable area and having the hud move when the car moves. I tried to find another example that showed how to accomplish this but was unsuccessful in finding one. Do I need to use the "warp" object? What is the best way to accomplish this? Thanks in advance!

    Oh, bonus question!

    Is there a plugin that helps making working with timers a bit easier? Right now I am building my own timer using the "every X milliseconds" event.

  • just keep all the HUD on seperate layer and set the scrolling of that layer to 0 x/y

  • just keep all the HUD on seperate layer and set the scrolling of that layer to 0 x/y

    Thanks The_Funny_Guy! Back to work!

  • glad to help

  • [quote:7mm9im76] set the scrolling of that layer to 0 x/y

    This is the first time I have played with the layer feature in construct. I am a little confused on what you mean by this. Could you elaborate a little?

  • well, on bottom of the right side of the construct UI you see couple of tabs: Project, Animator and Layers. Click Layers.

    You wil propably see one Layer.

    Click that little "File iconwith green triangle" then ensure it is on the top (by clicking on the gray upward triangle icon).

    Then click and hold the sprites and other HUD related elements and drag then "On to" the layer you recently created (literaly - on it) and drop it. From now on the elements you draged will be assigned to be on that layer (you can always do the same with anything and any layer).

    Then click that layer and on the left prosperities tab look for "Scroll Rate X" and "Scroll Rate Y" and set both to 0%.

    and you are preety much done

  • well, on bottom of the right side of the construct UI you see couple of tabs: Project, Animator and Layers. Click Layers.

    You wil propably see one Layer.

    Click that little "File iconwith green triangle" then ensure it is on the top (by clicking on the gray upward triangle icon).

    Then click and hold the sprites and other HUD related elements and drag then "On to" the layer you recently created (literaly - on it) and drop it. From now on the elements you draged will be assigned to be on that layer (you can always do the same with anything and any layer).

    Then click that layer and on the left prosperities tab look for "Scroll Rate X" and "Scroll Rate Y" and set both to 0%.

    and you are preety much done

    This is exactly what I tried to do but it seems after I set the Scroll Rate for x & y to 0 the hud is no longer visable.

  • in this case i need to ask for a cap file. i am 100% sure that the culprit is something very trivial but i cant name it without looking at the cap.

  • in this case i need to ask for a cap file. i am 100% sure that the culpr- it is something very trivial but i cant name it without looking at the cap.

    I'm not real comfortable sharing my cap file with all the work I have put into it so far. No offense meant in any way of course. I can tell you these points of information though.

    • The layout size is 4200x4200
    • The player controlled car is positioned near the bottom center of the layout at the start of the race.
    • In the Attributes of the car I have ticked "center view on me" which controls the scrolling
    • I have created one text object that shows the lap times and positioned it in the layout so when I launch the game it is right where I would like it to be.
    • I then created the second layer, made sure this layer was on top of the original layer and then dragged the text object onto the layer. After doing this I changed the Scrollxrate & Scrollyrate of the second layer to 0. When launching the game the text object timer is no where to be found.
  • You need to create the HUD at the origin of the screen: which is in the upper left corner. Make sure you have the right layer selected when you are adding elements.

  • I'm not real comfortable sharing my cap file with all the work I have put into it so far. No offense meant in any way of course. I can tell you these points of information though

    Would you be able to copy a second version of the cap with all un-related objects/events removed and graphics swapped with dummy images instead? All that would be needed is the timer, car, and layers I believe.

    Also, to check it is on the right layer, hide the top layer in the editor and see if the timer disappears. If it doesn't, then it needs to be copied and pasted into the new layer, then deleted from the old one.

  • You need to create the HUD at the origin of the screen: which is in the upper left corner. Make sure you have the right layer selected when you are adding elements.

    Worked a charm! Many thanks, I should of assumed that.

  • How could I have it so the HUD doesn't rotate as well? (Rotate camera without rotating HUD?)

    I would love to know how to do that!

  • How could I have it so the HUD doesn't rotate as well? (Rotate camera without rotating HUD?)

    I would love to know how to do that!

    You'd have to rotate the other layers individually using system > layers > set layer angle

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > How could I have it so the HUD doesn't rotate as well? (Rotate camera without rotating HUD?)

    >

    > I would love to know how to do that!

    >

    You'd have to rotate the other layers individually using system > layers > set layer angle

    Maybe an easier way is to just rotate the HUD layer instead (so if the whole thing is rotated at an angle, rotate the HUD layer in the opposite direction eg: game is 180 degrees, hud is -180), that way you only need to rotate one of the layers.

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