Moving Hud Relavant to Viewable Screen.

For questions about using Classic.

Post » Fri Jun 24, 2011 5:06 pm

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.
B
2
G
1
Posts: 37
Reputation: 524

Post » Fri Jun 24, 2011 5:08 pm

just keep all the HUD on seperate layer and set the scrolling of that layer to 0 x/y
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Fri Jun 24, 2011 5:21 pm

[quote="The_Funny_Guy":1gs0407q]just keep all the HUD on seperate layer and set the scrolling of that layer to 0 x/y[/quote:1gs0407q]

Thanks The_Funny_Guy! Back to work! ;)
B
2
G
1
Posts: 37
Reputation: 524

Post » Fri Jun 24, 2011 5:25 pm

glad to help :)
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Fri Jun 24, 2011 6:07 pm

[quote:7mm9im76] set the scrolling of that layer to 0 x/y[/quote:7mm9im76]
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?
B
2
G
1
Posts: 37
Reputation: 524

Post » Fri Jun 24, 2011 6:29 pm

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 :)
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Fri Jun 24, 2011 6:36 pm

[quote="The_Funny_Guy":17at6m36]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 :)[/quote:17at6m36]

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.
B
2
G
1
Posts: 37
Reputation: 524

Post » Fri Jun 24, 2011 7:13 pm

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.
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Fri Jun 24, 2011 7:28 pm

[quote="The_Funny_Guy":3b5y38wz]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.[/quote:3b5y38wz]

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. :shock:
B
2
G
1
Posts: 37
Reputation: 524

Post » Fri Jun 24, 2011 7:34 pm

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.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests