本文整理汇总了C++中BBox::containPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ BBox::containPoint方法的具体用法?C++ BBox::containPoint怎么用?C++ BBox::containPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BBox
的用法示例。
在下文中一共展示了BBox::containPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleMouseUp
bool ProfileWindow::handleMouseUp(Point p){
Point screen_point = screen_to_obj(p.getX(),p.getY());
for(int a = 0; a < 5; a++){
BBox currentBBox = colors[a]->getBBox();
if(currentBBox.containPoint(screen_point)){
//character->setColor(colors[a]->getColor());
cout << "yay" << endl;
delete character;
profile.setColor(colors[a]->getColor());
character = new Rectangle1(6.0, 6.0, Point(0.0, 2.0), "data/character/profilepage",profile.getColor());
}
}
BBox currentBBox = pexit->getBBox();
if(currentBBox.containPoint(screen_point)){
pexit->setColor(Color(0.5, 0.0, 1.0));
exit(0);
}
currentBBox = save->getBBox();
if(currentBBox.containPoint(screen_point)){
profile.setNick(nickname->getString());
save->setColor(Color(0.5, 0.0, 1.0));
saveProfile();
return true;
}
return false;
}
示例2: handleMouseDown
bool ProfileWindow::handleMouseDown(Point p){
Point screen_point = screen_to_obj(p.getX(),p.getY());
for(int a = 0; a < 5; a++){
BBox currentBBox = colors[a]->getBBox();
if(currentBBox.containPoint(screen_point)){
return true;
}
}
BBox currentBBox = pexit->getBBox();
if(currentBBox.containPoint(screen_point)){
pexit->setColor(Color(0.0,1.0, 0.0));
return true;
}
currentBBox = save->getBBox();
if(currentBBox.containPoint(screen_point)){
save->setColor(Color(0.0, 1.0, 0.0));
return true;
}
return false;
}