Make menu open linearly to the right of the action point

This commit is contained in:
esteldunedain 2015-04-04 01:44:49 -03:00
parent a5ff34e1d8
commit 7617908ad3
3 changed files with 8 additions and 8 deletions

View File

@ -35,8 +35,8 @@ GVAR(iconCount) = GVAR(iconCount) + 1;
if(_icon == "") then {
_icon = DEFAULT_ICON;
};
_text = format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center'>%4</t>", _icon, _color, _color, _text];
_text = format ["<img image='%1' color='%2' align='left'/><t color='%3' size='0.80'>%4</t>", _icon, _color, _color, _text];
_ctrl ctrlSetStructuredText (parseText _text);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW];
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.10*SafeZoneW, 0.035*SafeZoneW];
//_ctrl ctrlSetBackgroundColor [0, 1, 0, 0.1];
_ctrl ctrlCommit 0;

View File

@ -92,7 +92,7 @@ if (_numChildren == 1) then {
};
// Scale menu based on the amount of children
_scale = 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5);
_scale = 0.17;
// Animate menu scale
if (_menuInSelectedPath && (_menuDepth == count _path)) then {
_scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1));
@ -106,8 +106,8 @@ _angle = _centerAngle - _angleSpan / 2;
{
//BEGIN_COUNTER(children);
private ["_offset","_newPos"];
_newPos = [(_sPos select 0) -_scale * cos _angle,
(_sPos select 1) +_scale * (sin _angle) * 4/3];
_newPos = [(_sPos select 0) + _scale * 1.10,
(_sPos select 1) + _scale * 0.30 * 4/3 * (_foreachindex - _numChildren/2 + 0.5)];
//drawLine3D [_pos, _newPos, [1,0,0,0.8]];
//END_COUNTER(children);

View File

@ -24,7 +24,7 @@ private "_ctrl";
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
GVAR(iconCount) = GVAR(iconCount) + 1;
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6' align='center'/>", _icon]);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW];
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6'/>", _icon]);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW];
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
_ctrl ctrlCommit 0;