本文整理汇总了C++中Box2D::getBottomSide方法的典型用法代码示例。如果您正苦于以下问题:C++ Box2D::getBottomSide方法的具体用法?C++ Box2D::getBottomSide怎么用?C++ Box2D::getBottomSide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box2D
的用法示例。
在下文中一共展示了Box2D::getBottomSide方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void RectangleSDL::draw(Box2D & area, Color::enColor color, SDL_Surface *screen) {
GLfloat c = 0.5;
glBegin(GL_LINE_LOOP);
glColor3f(c, c, c);
glVertex2i(area.getLeftSide(), area.getTopSide());
glVertex2i(area.getRightSide(), area.getTopSide());
glVertex2i(area.getRightSide(), area.getBottomSide());
glVertex2i(area.getLeftSide(), area.getBottomSide());
glEnd();
/*
SDL_Color c = Color::getColor(color);
boxRGBA(screen, area.getLeftSide(), area.getTopSide(), area.getRightSide(), area.getBottomSide(), c.r, c. g, c. b, 255);
*/
}
示例2: generateObjects
/*
* Gera n objetos aleatórios
*/
void QtSDL::generateObjects(int n) {
int x, y, size;
bool horizontal;
bool vertical;
int speed;
objects->clear();
Box2D limits = getRoot()->getArea();
for (int i=0; i < n; i++) {
x = randomNumber(limits.getLeftSide() + 5, limits.getRightSide() - 5);
y = randomNumber(limits.getTopSide() + 5, limits.getBottomSide() - 5);
size = randomNumber(2, 6);
horizontal = randomBool();
vertical = randomBool();
speed = randomNumber(1, 2);
objects->push_back(new RectangleSDL(Color::Blue, x, y, size, horizontal, vertical, speed));
}
}