Beispiel #1
0
UINodeBar* UI::setBarMax (const std::string& window, const std::string& nodeId, uint16_t max)
{
	UINodeBar* node = getNode<UINodeBar>(window, nodeId);
	if (!node) {
		error(LOG_CLIENT, "could not get the node with the id " + nodeId + " from window " + window);
		return nullptr;
	}
	node->setMax(max);
	return node;
}
Beispiel #2
0
IntroBarDescription::IntroBarDescription(IFrontend* frontend, const Color& barColor, const std::string& text) :
		UINode(frontend) {
	setLayout(new UIHBoxLayout(0.01f, false, NODE_ALIGN_MIDDLE));
	const float barHeight = 12.0f / _frontend->getHeight();
	const float barWidth = 102.0f / _frontend->getWidth();
	UINodeBar* timeBar = new UINodeBar(_frontend);
	timeBar->setMax(100);
	timeBar->setCurrent(100);
	timeBar->setBarColor(barColor);
	timeBar->setBorder(true);
	timeBar->setBorderColor(colorWhite);
	timeBar->setSize(barWidth, barHeight);
	add(timeBar);
	UINodeLabel* label = new UINodeLabel(frontend, text, getFont(HUGE_FONT));
	label->setColor(colorBlack);
	add(label);
}