HUD position on multiple screen sizes

Get help using Construct 2

Post » Sun Aug 04, 2013 8:22 pm

I have trouble positioning HUD item on fixed place on different screen sizes. I wish to place inventory items on fixed position (right bottom corner, separated with 32px empty space on right and bottom sides).


Project is set to Letterbox scale and testing with Cocoon JS (on iPhone 5) it switches to scale outer, saying Letterbox scale fullscreen modes are not supported on this platform. Testing with Chrome on my PC it seems working, but on iPhone it's not positioned same way. Inventory box is only partially visible.

How should I solve that?
B
5
G
1
Posts: 12
Reputation: 897

Post » Sun Aug 04, 2013 9:25 pm

Look intro the anchor behaviour
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 Aug 04, 2013 9:32 pm

Actually it is anchor. But if I create that object on start of layout then I have to assign position.

At the moment I used for X and Y position:

x -> ViewportRight("main")-inventoryItemsBg.Width-370
y-> ViewportBottom("main")-inventoryItemsBg.Height-100


But that doesn't position that object perfectly.gamefriik2013-08-04 21:33:33
B
5
G
1
Posts: 12
Reputation: 897

Post » Sat Aug 10, 2013 9:39 am

Hmm, seems that my anchor doesn't work at all or I don't understand how anchor works..

Am I right, that setting anchor behavior to object (top, right) it should position that object to top-right on the start of layout, (doesn't matter where object is positioned before)?

Here is blank anchor test file: https://dl.dropboxusercontent.com/u/51555055/anchor-test.capx
B
5
G
1
Posts: 12
Reputation: 897

Post » Sat Aug 10, 2013 9:42 am

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


Return to How do I....?

Who is online

Users browsing this forum: Held, mikehive, Ninjadoodle, NN81 and 11 guests