[CAPX INCLUDED] Scale layer to window size/viewport width?

Get help using Construct 2

Post » Sat Jan 02, 2016 5:43 pm

zenox98 wrote:
Zebbi wrote:
LittleStain wrote:You could set the width of the hud to viewportleft()-viewportright()?

On the scale layer expression, I'm getting a syntax error with that first closed bracked ')', it's missing something?


As outlined in the manual - those expressions require a 'Layer' component between the brackets.

Sorry, forgot that part! I can't find any layer component that works with this expression?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sat Jan 02, 2016 5:57 pm

try 0, or 1, or "HUD"
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

Post » Sat Jan 02, 2016 6:06 pm

LittleStain wrote:try 0, or 1, or "HUD"

HUD didn't work, 0 and 1 just made the HUD disappear?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sat Jan 02, 2016 7:13 pm

Zebbi wrote:
LittleStain wrote:try 0, or 1, or "HUD"

HUD didn't work, 0 and 1 just made the HUD disappear?


What is the event you used?
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

Post » Sat Jan 02, 2016 8:12 pm

LittleStain wrote:
Zebbi wrote:
LittleStain wrote:try 0, or 1, or "HUD"

HUD didn't work, 0 and 1 just made the HUD disappear?


What is the event you used?


Set layer scale?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sun Jan 03, 2016 12:41 am

Zebbi wrote:Set layer scale?


That is an action, but you set the layerscale to viewportleft(0)-viewportright(0) , so you set the layerscale to 500 or more?
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

Post » Sun Jan 03, 2016 12:47 am

LittleStain wrote:
Zebbi wrote:Set layer scale?


That is an action, but you set the layerscale to viewportleft(0)-viewportright(0) , so you set the layerscale to 500 or more?

Yes, I have it so that if that scaling mode is set (test for variable) then set the scale of layer to viewportleft(0)-viewportright(0). The capx is exactly as I have it setup, so if you can try anything that will resize that bluebar to the right width when scale outer is used (dynamically, not fixed, so it works on all aspect ratios), it would be solved! Like I mentioned, 1.3 is the right size for a 16:9 screen, but not for a 4:3 ratio.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sun Jan 03, 2016 12:51 am

Setting the scale of the layer to such an enormously high number isn't what you are after..
If you set the width of the bar to viewportright()-viewportleft(), however..
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

Post » Sun Jan 03, 2016 1:05 am

LittleStain wrote:Setting the scale of the layer to such an enormously high number isn't what you are after..
If you set the width of the bar to viewportright()-viewportleft(), however..

Yes, that would work, but I need not just that bar but the other items on the layer resized too, all of the score and life and health numbers. 1.3 isn't enormously high for a layer scale, it's only a third(ish) bigger. Can I scale a whole group of items so they're exactly the same relative size? If not, that's why I wanted to use a dynamic layer scale figure depending on the resolution of the players screen.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sun Jan 03, 2016 2:25 pm

LittleStain wrote:Setting the scale of the layer to such an enormously high number isn't what you are after..
If you set the width of the bar to viewportright()-viewportleft(), however..

@LittleStain Is there a way of scaling a group of items so they relatively meet the correct width? Like I say, the bar will have many other items on it that need to be scaled relatively, which I was I was scaling the layer.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 53 guests