/** * Set entity to be added to level, if mouse pressed occured inside the level editor side bar. */ bool LevelEditor::SetTool(Vec2D &mousePos) { if(PointIsInside(mousePos, m_wallIcon)) { m_currentTool = WALL; return true; } if(PointIsInside(mousePos, m_spawnIcon)) { m_currentTool = ENEMY_SPAWN_POINT; return true; } return false; }
bool cWidgetWindow::OnMouseLeave(cGuiMessageData &aData) { cVector3f vLastGlobal = GetGlobalPosition(); if(mbMoving) SetGlobalPosition(mvRelMousePos + cVector3f(aData.mvPos.x, aData.mvPos.y,0)); //Check so that mouse is not outside of clip area. if(PointIsInside(aData.mvPos, false)==false) { SetGlobalPosition(vLastGlobal); mbMoving = false; } return false; }