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

◆ BuildFloatingCursor()

void ActionTargetsCursor::BuildFloatingCursor ( bool forceRebuild)
inlineprotected

Get OnScreenPos when forced or targeted component differs

in case of cached item, all above is reused except the position

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

243 {
244 float pos_x, pos_y = 0.0;
245
247
249 if (forceRebuild || m_Target.GetComponentIndex() != m_CachedObject.GetCursorCompIdx())
250 {
251 GetOnScreenPosition(pos_x, pos_y);
252 }
254 else
255 {
256 vector screen_pos = TransformToScreenPos(m_CachedObject.GetCursorWorldPos());
257
258 pos_x = screen_pos[0];
259 pos_y = screen_pos[1];
260 }
261
262 pos_x = Math.Ceil(pos_x);
263 pos_y = Math.Ceil(pos_y);
264
265 Widget parentWdg = m_Root.GetParent();
266
267 float screen_w = 0;
268 float screen_h = 0;
269
270 float wdg_w = 0;
271 float wdg_h = 0;
272
273 parentWdg.GetScreenSize(screen_w, screen_h);
274 m_Root.GetSize(wdg_w, wdg_h);
275
276 if (pos_x + wdg_w > screen_w)
277 pos_x = screen_w - wdg_w;
278
279 if (pos_y + wdg_h > screen_h)
280 pos_y = screen_h - wdg_h;
281
282 m_Root.SetPos(pos_x, pos_y);
283 }
Widget m_Root
Определения ActionTargetsCursor.c:85
void GetOnScreenPosition(out float x, out float y)
Определения ActionTargetsCursor.c:471
ActionTarget m_Target
Определения ActionTargetsCursor.c:61
vector TransformToScreenPos(vector pWorldPos)
transform world pos to screen pos (related to parent widget size)
Определения ActionTargetsCursor.c:454
ref ATCCachedObject m_CachedObject
Определения ActionTargetsCursor.c:62
void PrepareCursorContent()
Определения ActionTargetsCursor.c:196
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки Math::Ceil(), GetOnScreenPosition(), m_CachedObject, m_Root, m_Target, PrepareCursorContent() и TransformToScreenPos().

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