Jump to content
NumbNutsJunior

Control Posititon Relative Conversion?

Recommended Posts

I am unable to collect examples right now because I am on mobile but my issue is that I need to convert the relative position of a 2D control group control to its position relative to the control group's parent display.

 

The reason is because I need to compare the position of a control group control to a display control and I cannot get around having to use a control group.

 

If anyone has any solutions or suggestions, that would be greatly appriciated!

Share this post


Link to post
Share on other sites

Its just the position of the controlsGroup within the parent display, plus the position of control within the controlsGroup.

_display = findDisplay #;
_controlsGroup = _display displayCtrl #;
_controlsGroupCtrl = _controlsGroup controlsGroupCtrl #;

_relativePos = ctrlPosition _controlsGroup select[ 0, 2 ];
{
	_relativePos set[ _forEachIndex, ( _relativePos select _forEachIndex ) + _x ];
}forEach ( ctrlPosition _controlsGroupCtrl select[ 0, 2 ] );

 

  • Thanks 1

Share this post


Link to post
Share on other sites
14 hours ago, Larrow said:

Its just the position of the controlsGroup within the parent display, plus the position of control within the controlsGroup.


_display = findDisplay #;
_controlsGroup = _display displayCtrl #;
_controlsGroupCtrl = _controlsGroup controlsGroupCtrl #;

_relativePos = ctrlPosition _controlsGroup select[ 0, 2 ];
{
	_relativePos set[ _forEachIndex, ( _relativePos select _forEachIndex ) + _x ];
}forEach ( ctrlPosition _controlsGroupCtrl select[ 0, 2 ] );

 

 

Thank you man. I knew it was something simple, worked perfectly.

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

×