MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / renderCursor

Method renderCursor

source/frontend/StarTitleScreen.cpp:535–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535void TitleScreen::renderCursor() {
536 auto assets = Root::singleton().assets();
537
538 Vec2I cursorPos = m_cursorScreenPos;
539 Vec2I cursorSize = m_cursor.size();
540 Vec2I cursorOffset = m_cursor.offset();
541 unsigned int cursorScale = m_cursor.scale(interfaceScale());
542 Drawable cursorDrawable = m_cursor.drawable();
543
544 cursorPos[0] -= cursorOffset[0] * cursorScale;
545 cursorPos[1] -= (cursorSize[1] - cursorOffset[1]) * cursorScale;
546
547 if (!m_guiContext->trySetCursor(cursorDrawable, cursorOffset, cursorScale))
548 m_guiContext->drawDrawable(cursorDrawable, Vec2F(cursorPos), cursorScale);
549}
550
551float TitleScreen::interfaceScale() const {
552 return m_guiContext->interfaceScale();

Callers

nothing calls this directly

Calls 8

singletonClass · 0.85
assetsMethod · 0.80
trySetCursorMethod · 0.80
sizeMethod · 0.45
offsetMethod · 0.45
scaleMethod · 0.45
drawableMethod · 0.45
drawDrawableMethod · 0.45

Tested by

no test coverage detected