本文整理汇总了C++中gcn::MouseEvent::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ MouseEvent::getY方法的具体用法?C++ MouseEvent::getY怎么用?C++ MouseEvent::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcn::MouseEvent
的用法示例。
在下文中一共展示了MouseEvent::getY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseReleased
void PlayControllerZone::mouseReleased( gcn::MouseEvent& mouseEvent )
{
model().setMouse( "ZoneO",
mouseEvent.getX(),
mouseEvent.getY() );
//
// Tenemos un area para seleccionar.
adjustSelectedArea( mouseEvent.getX(),
mouseEvent.getY() );
switch ( mouseEvent.getButton() )
{
case gcn::MouseEvent::LEFT:
view().setSelectedArea( m_selectarea );
break;
case gcn::MouseEvent::RIGHT:
view().setDestination( m_selectarea );
break;
default:
break;
}
mouseEvent.consume();
}
示例2: getTitleBarHeight
void
Wellcome::mousePressed(gcn::MouseEvent &event)
{
gcn::Rectangle d1, d2, d3, d4;
d1.setAll(mNext->getDimension().x,
mNext->getDimension().y + getTitleBarHeight(),
mNext->getDimension().x + mNext->getDimension().width,
mNext->getDimension().y + mNext->getDimension().height + getTitleBarHeight());
d2.setAll(mPrev->getDimension().x,
mPrev->getDimension().y + getTitleBarHeight(),
mPrev->getDimension().x + mPrev->getDimension().width,
mPrev->getDimension().y + mPrev->getDimension().height + getTitleBarHeight());
d3.setAll(mFinish->getDimension().x,
mFinish->getDimension().y + getTitleBarHeight(),
mFinish->getDimension().x + mFinish->getDimension().width,
mFinish->getDimension().y + mFinish->getDimension().height + getTitleBarHeight());
d4.setAll(mAgain->getDimension().x,
mAgain->getDimension().y + getTitleBarHeight(),
mAgain->getDimension().x + mAgain->getDimension().width,
mAgain->getDimension().y + mAgain->getDimension().height + getTitleBarHeight());
if(d1.isPointInRect(event.getX(), event.getY()) ||
d2.isPointInRect(event.getX(), event.getY()) ||
d3.isPointInRect(event.getX(), event.getY()) ||
d4.isPointInRect(event.getX(), event.getY()) ||
event.getY()<getTitleBarHeight())
{
Window::mousePressed(event);
return;
}
setActionEventId("next");
distributeActionEvent();
}
示例3: mouseDragged
void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event)
{
if (event.getButton() == gcn::MouseEvent::LEFT)
{
if (!mItemMoved && mItemClicked)
{
const int index = getIndexFromGrid(event.getX(), event.getY());
const int itemId = itemShortcut->getItem(index);
if (index == -1 || itemId < 0)
return;
Item *item = player_node->getInventory()->findItem(itemId);
if (item)
{
mItemMoved = item;
itemShortcut->removeItem(index);
}
}
if (mItemMoved)
{
mCursorPosX = event.getX();
mCursorPosY = event.getY();
}
}
}
示例4: mouseDragged
void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event)
{
if (event.getButton() == gcn::MouseEvent::LEFT)
{
if (!mEmoteMoved && mEmoteClicked)
{
const int index = getIndexFromGrid(event.getX(), event.getY());
if (index == -1)
return;
const int emoteId = emoteShortcut->getEmote(index);
if (emoteId)
{
mEmoteMoved = emoteId;
emoteShortcut->removeEmote(index);
}
}
if (mEmoteMoved)
{
mCursorPosX = event.getX();
mCursorPosY = event.getY();
}
}
}
示例5: mouseDragged
void OutfitWindow::mouseDragged(gcn::MouseEvent &event)
{
Window::mouseDragged(event);
if (event.getButton() == gcn::MouseEvent::LEFT)
{
if (!mItemMoved && mItemClicked)
{
const int index = getIndexFromGrid(event.getX(), event.getY());
if (index == -1)
return;
const int itemId = mItems[mCurrentOutfit][index];
if (itemId < 0)
return;
Item *item = PlayerInfo::getInventory()->findItem(itemId);
if (item)
{
mItemMoved = item;
mItems[mCurrentOutfit][index] = -1;
}
}
if (mItemMoved)
{
mCursorPosX = event.getX();
mCursorPosY = event.getY();
}
}
}
示例6: mousePressed
void TileSelector::mousePressed(gcn::MouseEvent& mouseEvent)
{
if (mouseEvent.getX() <= mTileSetBitmap->w
&& mouseEvent.getY() <= mTileSetBitmap->h)
{
mSelectedTile = mouseEvent.getX() / 16
+ (mouseEvent.getY() / 16) * mTileSetBitmap->w / 16;
generateAction();
}
}
示例7: mouseEntered
void PlayControllerZone::mouseEntered( gcn::MouseEvent& mouseEvent )
{
model().setMouse( "Zone",
mouseEvent.getX(),
mouseEvent.getY() );
view().updateMoveView( mouseEvent.getX(),
mouseEvent.getY() );
mouseEvent.consume();
}
示例8: mouseDragged
void PlayControllerZone::mouseDragged( gcn::MouseEvent& mouseEvent )
{
model().setMouse( "ZoneE",
mouseEvent.getX(),
mouseEvent.getY() );
adjustSelectedArea( mouseEvent.getX(),
mouseEvent.getY() );
view().paintSelectedArea( m_selectarea );
mouseEvent.consume();
}
示例9: mouseMoved
void MouseSelectionMenu::mouseMoved(gcn::MouseEvent &mouseEvent)
{
WidgetListIterator iter;
for( iter = mWidgets.begin(); iter != mWidgets.end(); iter++ ) {
if( mouseEvent.getY() > (*iter)->getY() && mouseEvent.getY() < (*iter)->getY() + (*iter)->getHeight() ) {
drawRect.x = (*iter)->getX() - 1;
drawRect.y = (*iter)->getY() - 1;
drawRect.width = (*iter)->getWidth() + 1;
drawRect.height = (*iter)->getHeight() + 1;
return;
}
}
}
示例10: mouseMoved
void TileSelector::mouseMoved(gcn::MouseEvent& mouseEvent)
{
if (mouseEvent.getX() <= mTileSetBitmap->w
&& mouseEvent.getY() <= mTileSetBitmap->h)
{
mCurrentMouseX = mouseEvent.getX();
mCurrentMouseY = mouseEvent.getY();
mDrawMouseHoverTile = true;
}
else
{
mDrawMouseHoverTile = false;
}
}
示例11: mousePressed
void Windowiki::mousePressed(gcn::MouseEvent &event)
{
// Let Guichan move window to top and figure out title bar drag
gcn::Window::mousePressed(event);
const int x = event.getX();
const int y = event.getY();
mMouseResize = 0;
// Activate resizing handles as appropriate
if (event.getSource() == this && isResizable() &&
event.getButton() == gcn::MouseEvent::LEFT &&
!getChildrenArea().isPointInRect(x, y))
{
mMouseResize |= (x > getWidth() - resizeBorderWidthiki) ? RIGHT :
(x < resizeBorderWidthiki) ? LEFT : 0;
mMouseResize |= (y > getHeight() - resizeBorderWidthiki) ? BOTTOM :
(y < resizeBorderWidthiki) ? TOP : 0;
}
else if (event.getSource() == mGrip)
{
mDragOffsetX = x + mGrip->getX();
mDragOffsetY = y + mGrip->getY();
mMouseResize |= BOTTOM | RIGHT;
mIsMoving = false;
}
if (event.getButton() == gcn::MouseEvent::LEFT)
{
const int x = event.getX();
const int y = event.getY();
// Handle close button
if (mCloseButton)
{
gcn::Rectangle closeButtonRect(
getWidth() - closeImage->getWidth() - getPadding(),
getPadding(),
closeImage->getWidth(),
closeImage->getHeight());
if (closeButtonRect.isPointInRect(x, y))
{
setVisible(false);
}
}
// Handle window resizing
}
}
示例12: mousePressed
void DropDown::mousePressed(gcn::MouseEvent& mouseEvent)
{
gcn::DropDown::mousePressed(mouseEvent);
if (0 <= mouseEvent.getY() && mouseEvent.getY() < getHeight() &&
mouseEvent.getX() >= 0 && mouseEvent.getX() < getWidth() &&
mouseEvent.getButton() == gcn::MouseEvent::LEFT && mDroppedDown &&
mouseEvent.getSource() == mListBox)
{
mPushed = false;
foldUp();
releaseModalMouseInputFocus();
distributeActionEvent();
}
}
示例13: mouseEntered
void PlayControllerMsgCenter::mouseEntered( gcn::MouseEvent& mouseEvent )
{
model().setMouse( "MsgCenter",
mouseEvent.getX(),
mouseEvent.getY() );
mouseEvent.consume();
}
示例14: mouseMoved
void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
{
Popup::mouseMoved(event);
const int x = event.getX();
const int y = event.getY();
if (event.getSource() == mXpBar)
{
mTextPopup->show(x + getX(), y + getY(),
strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
PlayerInfo::getAttribute(EXP_NEEDED)),
strprintf("%s: %u", _("Need"),
PlayerInfo::getAttribute(EXP_NEEDED)
- PlayerInfo::getAttribute(EXP)));
}
else if (event.getSource() == mHpBar)
{
mTextPopup->show(x + getX(), y + getY(),
strprintf("%u/%u", PlayerInfo::getAttribute(HP),
PlayerInfo::getAttribute(MAX_HP)));
}
else if (event.getSource() == mMpBar)
{
mTextPopup->show(x + getX(), y + getY(),
strprintf("%u/%u", PlayerInfo::getAttribute(MP),
PlayerInfo::getAttribute(MAX_MP)));
}
else
{
mTextPopup->setVisible(false);
}
}
示例15: mouseReleased
void ItemContainer::mouseReleased(gcn::MouseEvent &event)
{
if (mClicks == 2)
return;
switch (mSelectionStatus)
{
case SEL_SELECTING:
mSelectionStatus = SEL_SELECTED;
return;
case SEL_DESELECTING:
selectNone();
return;
case SEL_DRAGGING:
mSelectionStatus = SEL_SELECTED;
break;
case SEL_NONE:
case SEL_SELECTED:
default:
return;
};
int index = getSlotIndex(event.getX(), event.getY());
if (index == Inventory::NO_SLOT_INDEX)
return;
if (index == mSelectedIndex || mSelectedIndex == -1)
return;
Net::getInventoryHandler()->moveItem(mSelectedIndex, index);
selectNone();
}