DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdatePos()

void ScriptedWidgetEventHandler::UpdatePos ( )
inlineprotected

Function updating the position of the tracker widget.

Currently tracks using GetScreenPos() on the position of the player.

См. определение в файле CTObjectFollower.c строка 90

91 {
92 vector relativePos;
93
94 relativePos = GetGame().GetScreenPosRelative( GetPosition() );
95
96 if( relativePos[0] >= 1 || relativePos[0] == 0 || relativePos[1] >= 1 || relativePos[1] == 0 )
97 {
98 m_FollowerRoot.Show( false );
99 return;
100 }
101 else if( relativePos[2] < 0 )
102 {
103 m_FollowerRoot.Show( false );
104 return;
105 }
106 else
107 {
108 m_FollowerRoot.Show( true );
109 }
110
111 float x, y;
112 m_FollowerRoot.GetSize( x, y );
113
114 m_FollowerRoot.SetPos( relativePos[0], relativePos[1] );
115 }
Icon x
Icon y
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
vector GetPosition()
Определения CTKeyframe.c:97
Widget m_FollowerRoot
Определения CTObjectFollower.c:3
proto native CGame GetGame()

Перекрестные ссылки GetGame(), GetPosition, CGame::GetScreenPosRelative(), m_FollowerRoot, x и y.

Используется в SetPosition(), SetRotation() и Update().