void GXConsole::Draw() { if(Background) Background->Draw(); int PositionX = GetLeft(); int PositionY = GetTop(); int PositionZ = GetZPosition(); for(u32 i = 0; i < ConsoleRow.size(); i++) { fontSystem->drawText(PositionX, PositionY+i*(HeightBetweenLines+fontSize), PositionZ, ConsoleRow.at(i)->c_str(), fontSize, color, style); } }
int wxJoystick::GetPosition(unsigned axis) const { switch (axis) { case 0: return GetPosition().x; case 1: return GetPosition().y; case 2: return GetZPosition(); case 3: return GetRudderPosition(); case 4: return GetUPosition(); case 5: return GetVPosition(); default: return 0; } }
void Window::Draw() { // If the title is held, move the window if (isMovable && isMoving) { POINT prevPoint = clickedPoint; // Get the current point clickedPoint.x = userInput[clickedChannel].wpad->ir.x; clickedPoint.y = userInput[clickedChannel].wpad->ir.y; // Move the window, based on the top and left of this window // Therefor, we need to calculate the difference between the mouse down point and the topleft point of this window int newX = GetLeft() + (clickedPoint.x - prevPoint.x); int newY = GetTop() + (clickedPoint.y - prevPoint.y); // Move the window to newX and newY, but stay within the boundaries if (newX > 0 && newY > 0 && (GetParent() == NULL || (newX + GetWidth() < GetParent() -> GetWidth() && newY + GetHeight() < GetParent() -> GetHeight()))) { SetPosition(newX, newY); } } GXColor backgroundColor = (GXColor){226, 230, 237, 255}; Menu_DrawRectangle(this->GetLeft()+window_tile_vertical_left->GetWidth(), this->GetTop()+window_tile_horizontal_top->GetHeight(), GetZPosition(), width-window_tile_vertical_left->GetWidth()*2, height-window_tile_horizontal_top->GetHeight()*2, &backgroundColor, false, true); GuiFrame::Draw(); }