Jump to content
Sign in to follow this  
alleycat

How to set a display control to be stuck to the right edge of the screen?

Recommended Posts

How to set a display control to be stuck to the right edge of the screen no matter the resolution?

Share this post


Link to post
Share on other sites

I am having some issues however. Isnt safeszone supposed to make it work on all resolutions? When I attempted your example, the item was off screen on a 16:10 aspect. So I used the GUI editor, manually placed the object at the lower right corner with

	x = 0.944792 * safezoneW + safezoneX;
y = 0.948 * safezoneH + safezoneY;
w = 0.0583333 * safezoneW;
h = 0.07 * safezoneH;

However if I change aspect ratio, it never sticks to the lower right. Am I overlooking something?

Share this post


Link to post
Share on other sites

it's working fine for me, I've tried a few different aspect ratios (4:3, 16:9, 16:10)

just make sure that

x + w == safezoneW + safezoneX

then the control should stick to the right edge of the middle screen

Share this post


Link to post
Share on other sites

Having difficulty understanding the safezones again:

I would like to have a centered control however when using

				x = safezoneX + 0.1 * safezoneW;
			y = safezoneY + 0.1 * safezoneW;
			w = safezoneW * 0.8;
			h = safezoneH * 0.8;

This will create the control covering 80% of the screen. However I would like to downscale it (using an image). When changing any of these values it either gets scaled and moved towards a corner or offset in a direction. How to scale something while keeping it in the center?

Share this post


Link to post
Share on other sites

to keep it centered:

x + 0.5 * w == safezoneX + 0.5 * safezoneW
y + 0.5 * h == safezoneY + 0.5 * safezoneH

<=>

x == safezoneX + 0.5 * safezoneW - 0.5 * w
y == safezoneY + 0.5 * safezoneH - 0.5 * h

e.g. for 30% width & height:

x = safezoneX + 0.35 * safezoneW;
y = safezoneY + 0.35 * safezoneH;
w = safezoneW * 0.3;
h = safezoneH * 0.3;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×