How do I Keep UI objects centered in a "Scale Inner" Project

Get help using Construct 2

Post » Sun Jul 05, 2015 5:18 am

I'm talking about keeping something in the middle of the screen at the top or bottom or keeping things in the corner to resize with the view size. For some reason scale inner is throwing everything way off, and I've tried viewport, window, scrollx, but I just can't keep an object in the center on the UI at different sizes. Any ideas? Thanks.
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Post » Sun Jul 05, 2015 7:07 am

every tick

Object set position
X: (ViewportRight("UI") - ViewportLeft("UI")) / 2
Y: (ViewportBottom("UI") - ViewportTop("UI")) / 2
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 7:25 am

lennaert wrote:every tick

Object set position
X: (ViewportRight("UI") - ViewportLeft("UI")) / 2
Y: (ViewportBottom("UI") - ViewportTop("UI")) / 2


Thanks for the suggestion, but it looks like that didn't work either. I should note the element is on a 0,0 parallax layer, without an anchor, but I tried in a 100,100 as well. The element I'm trying to center is the White UI box.

Here's screenshots from both of my monitors, at neither resolution did it center. :cry:

http://puu.sh/iNGL8/15fbf6bf0c.png
http://puu.sh/iNGM0/afb5b1afd0.png
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Post » Sun Jul 05, 2015 7:29 am

ReflextionsDev wrote:
lennaert wrote:every tick

Object set position
X: (ViewportRight("UI") - ViewportLeft("UI")) / 2
Y: (ViewportBottom("UI") - ViewportTop("UI")) / 2


Thanks for the suggestion, but it looks like that didn't work either. I should note the element is on a 0,0 parallax layer, without an anchor, but I tried in a 100,100 as well. The element I'm trying to center is the White UI box.

Here's screenshots from both of my monitors, at neither resolution did it center. :cry:

http://puu.sh/iNGL8/15fbf6bf0c.png
http://puu.sh/iNGM0/afb5b1afd0.png



Does the image have its origin point in the center ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 4:31 pm

lennaert wrote:
ReflextionsDev wrote:
lennaert wrote:every tick

Object set position
X: (ViewportRight("UI") - ViewportLeft("UI")) / 2
Y: (ViewportBottom("UI") - ViewportTop("UI")) / 2


Thanks for the suggestion, but it looks like that didn't work either. I should note the element is on a 0,0 parallax layer, without an anchor, but I tried in a 100,100 as well. The element I'm trying to center is the White UI box.

Here's screenshots from both of my monitors, at neither resolution did it center. :cry:

http://puu.sh/iNGL8/15fbf6bf0c.png
http://puu.sh/iNGM0/afb5b1afd0.png



Does the image have its origin point in the center ?


It does, I just double checked.
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Post » Sun Jul 05, 2015 4:53 pm

Well, could be I'm missing something with Scale inner.

I generally apply that with scale outer, not really a fan of scale inner, as you can miss pieces of the layout
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 7:39 pm

lennaert wrote:Well, could be I'm missing something with Scale inner.

I generally apply that with scale outer, not really a fan of scale inner, as you can miss pieces of the layout


Scale inner was giving me a headache, so I'm willing to switch to scale outer. However, even after doing that something is off. I keep double checking everything and I can't imagine why it won't work.

http://puu.sh/iOd3U/47e431f673.png
http://puu.sh/iOd4u/fed5394878.png

Here's the .capx: https://dl.dropboxusercontent.com/u/441 ... redUI.capx
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Post » Sun Jul 05, 2015 9:18 pm

Something fishy going on there with the fullscreen mode >_>

If I have my window maxed, its off in the center ....
If I make my window smaller / not maxed, the centering works as expected.

I can't put my finger on it whats causing it.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Mon Jul 06, 2015 12:07 am

@lennaert Yeah there definitely is, maybe it's a bug? Hopefully someone can figure this out.
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Post » Sat Jul 11, 2015 4:35 pm

Bump.
Any ideas @Ashley ?

I'll re-post this to the bugs section if no one is able to figure it out, because I can't see I'm doing anything wrong.
B
71
S
24
G
11
Posts: 452
Reputation: 12,350

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 30 guests