Beispiel #1
0
UINode* UIWindow::addTextureNode (const std::string& texture, float x, float y, float w, float h)
{
	UINode* imageNode = new UINode(_frontend);
	imageNode->setImage(texture);
	imageNode->setPos(x, y);
	imageNode->setSize(w, h);
	add(imageNode);
	return imageNode;
}
void UIGameHelpWindow::addOuyaButton (UINode *panel, const std::string& texture, const std::string& title)
{
	UINode* hbox = createHPanel();
	UINode* imageNode = new UINode(_frontend);
	imageNode->setImage(texture);
	hbox->add(imageNode);
	UINodeLabel *label = new UINodeLabel(_frontend, title);
	label->setColor(colorWhite);
	label->setPos(0.0f, imageNode->getHeight() / 2.0f - label->getHeight() / 2.0f);
	hbox->add(label);
	panel->add(hbox);
}
void UIMapWindow::initHudNodes ()
{
	UINode* panel = new UINode(_frontend);
	panel->setImage("bones");
	panel->setStandardPadding();
	panel->setAlignment(NODE_ALIGN_TOP | NODE_ALIGN_CENTER);
	add(panel);

	UINode *innerPanel = new UINode(_frontend);
	innerPanel->setLayout(new UIHBoxLayout(0.01f));
	innerPanel->setPos(panel->getX() + 0.07f, panel->getY());
	_points = new UICavePackerNodePoint(_frontend, 30);
	_points->setFont(HUGE_FONT);
	_points->setId(UINODE_POINTS);
	innerPanel->add(_points);
	add(innerPanel);
}
UINode* UIGameHelpWindow::createTexture (const std::string& texture)
{
	UINode* imageNode = new UINode(_frontend);
	imageNode->setImage(texture);
	return imageNode;
}