mirror of
https://gitea.sffnetwork.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-11-22 02:19:45 +00:00
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
24
src/client/gui/components/OptionsItem.cpp
Executable file
24
src/client/gui/components/OptionsItem.cpp
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#include "OptionsItem.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../../util/Mth.h"
|
||||
OptionsItem::OptionsItem( std::string label, GuiElement* element )
|
||||
: GuiElementContainer(false, true, 0, 0, 24, 12),
|
||||
label(label) {
|
||||
addChild(element);
|
||||
}
|
||||
|
||||
void OptionsItem::setupPositions() {
|
||||
int currentHeight = 0;
|
||||
for(std::vector<GuiElement*>::iterator it = children.begin(); it != children.end(); ++it) {
|
||||
(*it)->x = x + width - (*it)->width - 15;
|
||||
(*it)->y = y + currentHeight;
|
||||
currentHeight += (*it)->height;
|
||||
}
|
||||
height = currentHeight;
|
||||
}
|
||||
|
||||
void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) {
|
||||
int yOffset = (height - 8) / 2;
|
||||
minecraft->font->draw(label, (float)x, (float)y + yOffset, 0x909090, false);
|
||||
super::render(minecraft, xm, ym);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue