Jump to content
Sign in to follow this  
bull_a

WorldToScreen RscTitle Trouble

Recommended Posts

My problem is that I am using the worldToScreen peice of code to work out the X and Y positions for a RscTitle dialog

However when I run the code the position is returned but the dialog/RscTitle does not move and will disappear a bit later

Here is my code (litterally cannot think of why this does not work)

// 3d Render test

// Creates the RscTitle

titleRsc ["BUL_test", "PLAIN"];
_control = ((findDisplay 1) displayCtrl 1000);
_rscPosition = ctrlPosition _control;

while {true} do
{
// Returns mans1 pos to screen pos
_screenPos = worldToScreen getpos man1;
// Debug
hint format ["%1 \n %2", _rscPosition, _screenPos];
// ** end of debug
if (count _screenPos > 0) then {
	_control ctrlSetPosition [(_screenPos select 0 * (safezoneW + safezoneX)), (_screenPos select 1 * (safezoneH + safezoneY)), (_rscPosition select 2), (_rscPosition select 3)];
	_control ctrlCommit 0;
};
sleep 0.5;
};

Problem solve...

Display is defined by setting a uiNamespace variable :)

Thanks,

Bull

Edited by Bull_A

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  

×