void move(Player* player, int mDir, int amount){ int x = 0; int y = 0; if(mDir==dright){ x = amount; } else if(mDir==dup){ y = amount; } else if(mDir==dleft){ x = -amount; } else if(mDir==ddown){ y = -amount; } moveLoc(player->loc,x,y); }
void TBarView::PositionWindow(BRect screenFrame) { float windowWidth, windowHeight; GetPreferredWindowSize(screenFrame, &windowWidth, &windowHeight); BPoint moveLoc(0, 0); // right, expanded if (!fLeft && fVertical) { if (fState == kFullState) moveLoc.x = screenFrame.right - fBarMenuBar->Frame().Width(); else moveLoc.x = screenFrame.right - windowWidth; } // bottom, full or corners if (!fTop) moveLoc.y = screenFrame.bottom - windowHeight; Window()->MoveTo(moveLoc); }