void TextButton::SetPosition(int x, int y) { if (UIText) { NVBFTextCursorPos(UIText, x, y); } }
void UI::Resize(int w, int h) { NVBFTextCursorAlign(m_uiLabelFetch, NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); NVBFTextCursorPos(m_uiLabelFetch, w*4/5, h/6); NVBFTextCursorAlign(m_uiLabelDirections, NVBF_ALIGN_LEFT, NVBF_ALIGN_CENTER); NVBFTextCursorPos(m_uiLabelDirections, w/5, h*2/3); NVBFTextCursorAlign(m_uiLabelMessage, NVBF_ALIGN_LEFT, NVBF_ALIGN_CENTER); NVBFTextCursorPos(m_uiLabelMessage, w/5 + 25, h*2/3 + 50); m_uiRequestGamerUUID.SetAlignment(NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); m_uiRequestGamerUUID.SetPosition(w*3/5, h/6); m_uiRequestProducts.SetAlignment(NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); m_uiRequestProducts.SetPosition(w*2/5, h/6); m_uiRequestPurchase.SetAlignment(NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); m_uiRequestPurchase.SetPosition(w*2/5, h/4); m_uiRequestReceipts.SetAlignment(NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); m_uiRequestReceipts.SetPosition(w*3/5, h/4); m_uiPause.SetAlignment(NVBF_ALIGN_CENTER, NVBF_ALIGN_CENTER); m_uiPause.SetPosition(w/2, h/2); for (int index = 0; index < m_products.size(); ++index) { m_products[index]->SetAlignment(NVBF_ALIGN_RIGHT, NVBF_ALIGN_CENTER); m_products[index]->SetPosition(w*0.45f, h/3 + index * 25); } for (int index = 0; index < m_receipts.size(); ++index) { m_receipts[index]->SetAlignment(NVBF_ALIGN_LEFT, NVBF_ALIGN_CENTER); m_receipts[index]->SetPosition(w*0.55f, h/3 + index * 25); } }
bool Engine::resizeIfNeeded() { if (!mResizePending) return false; int w = mEgl.getWidth(); int h = mEgl.getHeight(); mGlobeApp->resize(w, h); mLastX = w / 2; mLastY = h / 2; NVBFSetScreenRes(w, h); // 16:9 ws as default. if (m_clockText) { int height = (w > h) ? (h / 16) : (w / 16); NVBFTextSetSize(m_clockText, height); NVBFTextCursorAlign(m_clockText, NVBF_ALIGN_LEFT, NVBF_ALIGN_TOP); NVBFTextCursorPos(m_clockText, 10, 10); } mResizePending = false; return true; }