本文整理汇总了C++中menu::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ menu::getSize方法的具体用法?C++ menu::getSize怎么用?C++ menu::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::getSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: moveCamera
void moveCamera(dim move)
{
while(camera.loc.x+camera.size.x>currentMap->length-move.x)
move.x--;
while(camera.loc.y+camera.size.y>currentMap->length-move.y+bottomMenu.getSize().y)
move.y--;
while(camera.loc.x+move.x<0)
move.x++;
while(camera.loc.y+move.y<0)
move.y++;
camera.loc.x += move.x;
camera.loc.y += move.y;
}
示例3: autoRestore
void autoRestore(menu m)
{
//This still needs user input.
for(unsigned i = 0; i < m.getSize(); i++)
{
FS_Archive saveArch;
if(m.optSelected(i) && openSaveArch(&saveArch, sdTitle[i], false))
restoreData(sdTitle[i], saveArch, MODE_SAVE);
FSUSER_CloseArchive(&saveArch);
FS_Archive extArch;
if(m.optSelected(i) && openExtdata(&extArch, sdTitle[i], false))
restoreData(sdTitle[i], extArch, MODE_EXTDATA);
FSUSER_CloseArchive(&extArch);
}
}
示例4: autoBackup
void autoBackup(menu m)
{
showMessage("This can take a few minutes depending on how many titles are selected.");
progressBar autoDump((float)m.getSelectCount(), "Copying saves...");
//Keep track of what's done
float dumpCount = 0;
for(unsigned i = 0; i < m.getSize(); i++)
{
//This is for titles with no save archive ex. Fantasy Life
bool dumped = false;
FS_Archive saveArch;
if(m.optSelected(i) && openSaveArch(&saveArch, sdTitle[i], false))//if it's selected and we can open save archive
{
createTitleDir(sdTitle[i], MODE_SAVE);
backupData(sdTitle[i], saveArch, MODE_SAVE, true);
dumpCount++;
dumped = true;
}
FSUSER_CloseArchive(&saveArch);
FS_Archive extArch;
if(m.optSelected(i) && openExtdata(&extArch, sdTitle[i], false))
{
createTitleDir(sdTitle[i], MODE_EXTDATA);
backupData(sdTitle[i], extArch, MODE_EXTDATA, true);
//check first to make sure we don't count it twice because no save arch
if(!dumped)
dumpCount++;
}
FSUSER_CloseArchive(&extArch);
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
autoDump.draw(i);
sf2d_end_frame();
sf2d_swapbuffers();
}
showMessage("Complete!");
}