本文整理汇总了C++中menu::getLoc方法的典型用法代码示例。如果您正苦于以下问题:C++ menu::getLoc方法的具体用法?C++ menu::getLoc怎么用?C++ menu::getLoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::getLoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//Update() is where the magic happens,
//It Draws everything to the screen
void update(vector<character> *objects)
{
drawRect(0, 0, camera.size.x, camera.size.y, 0,150,0);
//drawRect(loc.x, loc.y, size.x, size.y, r, g, b);
SDL_Rect square;
//SDL_Rect* clip = NULL;
for(unsigned int i = 0; i < objects->size(); i++)
{
if(collide(camera, objects->at(i)))
{
//dim size = objects->at(i).size;;
dim loc = objects->at(i).loc;
loc.x-=camera.loc.x;
loc.y-=camera.loc.y;
square.x = loc.x;
square.y = loc.y;
int index = 0;
if (objects->at(i).type == green)
index = 1;
if (objects->at(i).type == blue)
index = 3;
if (objects->at(i).type == purple)
index = 5;
if (objects->at(i).selected)
index--;
if (objects->at(i).type == red)
index = 6;
if (objects->at(i).type == rock)
index = 7;
if (objects->at(i).type == rock2)
index = 8;
SDL_BlitSurface(images[index], NULL, mainframe, &square);
}
}
if (dragBox.on && (dragBox.size.x <= camera.size.x && dragBox.size.y <= camera.size.y))
drawRect(dragBox.loc.x, dragBox.loc.y, dragBox.size.x, dragBox.size.y, 0, 255, 255);
drawRect(bottomMenu.getLoc().x, bottomMenu.getLoc().y, bottomMenu.getSize().x, bottomMenu.getSize().y, 100, 100, 100);
SDL_Flip(mainframe);
return;
}