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

◆ TransformToScreenPos()

vector ActionTargetsCursor::TransformToScreenPos ( vector pWorldPos)
inlineprotected

transform world pos to screen pos (related to parent widget size)

get relative pos for screen from world pos vector

get size of parent widget

calculate corrent position from relative pos and parent widget size

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

456 {
457 float parent_width, parent_height;
458 vector transformed_pos, screen_pos;
459
461 screen_pos = GetGame().GetScreenPosRelative(pWorldPos);
463 m_Root.GetParent().GetScreenSize(parent_width, parent_height);
464
466 transformed_pos[0] = screen_pos[0] * parent_width;
467 transformed_pos[1] = screen_pos[1] * parent_height;
468
469 return transformed_pos;
Widget m_Root
Определения ActionTargetsCursor.c:85
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
proto native CGame GetGame()

Перекрестные ссылки GetGame(), CGame::GetScreenPosRelative() и m_Root.

Используется в BuildFloatingCursor() и GetOnScreenPosition().