Jump to content
Sign in to follow this  
Tuliq

Tips with UI object placement.

Recommended Posts

So I have a UI resource which I want to place in the lower right corner of the screen. It's a vertical list of the names of players connected to the game. I want this list to be displayed at the same relative position on the screen through all aspect-ratios and interface-sizes. Right now, it looks good and sits in place when I am in the "small" interface size, but my friend who has interface size set to "normal" will have this list of names cut off on his screen. What would I have to do to ensure that this list stays at the same relative spot on the screen for both of us?

Share this post


Link to post
Share on other sites

Have not played with UI much yet Tuliq but is this not an absolute versus safezone of how you place your resource.

On that page it says

aligned to bottom right corner

x = safezoneX + safezoneW - 0.2;
y = safezoneY + safezone[color="#FF0000"]W[/color] - 0.3;
w = 0.2;
h = 0.3;

Although i would of thought the bit ive highlighted in red should need to be the height not the width

Share this post


Link to post
Share on other sites

You might be right. That is what I am using though. Here is my resource definition.

class RscTitles {

class sniperList {
	idd = -1;
    fadeout=0;
    fadein=0;
	duration = 1;
	name= "sniperList";
	onLoad = "uiNamespace setVariable ['sniperList', _this select 0]";

	class controlsBackground {
		class sniperListText:RscStructuredText
		{
			idc = 6000;
			type = CT_STRUCTURED_TEXT;
			size = 0.047;
			x = 0.856875 * safezoneW + safezoneX;
			y = 0.686927 * safezoneH + safezoneY
			w = 0.3; h = 0.5;
			colorText[] = {1,1,1,1};
			lineSpacing = 4;
			colorBackground[] = {0,0,0,0};
			text = "";
			font = "PuristaMedium";
			shadow = 2;
			class Attributes {
				align = "right";
			};
		};

	};
};

};

I stole the gist of it from another script, so I am not sure about if this is the proper way to make a simple list resource. I am a total noob at dialogs..

---------- Post added at 16:03 ---------- Previous post was at 15:59 ----------

For now I have just moved the resource a tiny bit more to the left, so that if a player is using the normal interface size, he will see it.

Share this post


Link to post
Share on other sites

x = 0.856875 * safezoneW + safezoneX;
w = 0.3; h = 0.5; 

0.856875 + 0.3 > 1.

Is that not where your overlap is coming from?

Share this post


Link to post
Share on other sites

It doesn't overlap for me, but it does for other interface sizes other than small. I guess I should keep the values within the 0 - 1 range?

Share this post


Link to post
Share on other sites

//all variable values from 0 to 100
	x = "(_xPos/100)	* SafeZoneW + SafeZoneX";
	y = "(_yPos/100)	* SafeZoneH + SafeZoneY";
	w = "(_width/100)	* SafeZoneW";
	h = "(_height/100)	* SafeZoneH";

For 3 monitor setup, it should display only in the center screen.

If you want it on all three, you might need SafeZoneWAbs.

See also: http://community.bistudio.com/wiki/SafeZone

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  

×