Beispiel #1
0
void UIMenu::addMenuBreak() {
	UILabel* label = new UILabel(gfx);
	label->setColor(MENU_TEXT_COLOR);
	label->setText("...", 0, text_size);
	label->setPosition(vector2());
	label->setActive(false);
//	label->fadeIn();
	
	//size[0] = 18;
	size[1] = (labels_n+1)*text_size;
	
	gfx->addSceneNode(label, this);
	labels.push_back(label);
	labels_n++;	
}
Beispiel #2
0
void UIMenu::addMenuOption(const char* text, bool isSelected) {
	UILabel* label = new UILabel(gfx);
	if(isSelected)
		label->setColor(MENU_TEXT_COLOR_SELECTED);
	else label->setColor(MENU_TEXT_COLOR);
	label->setText(text, text_font, text_size);
	label->setPosition(vector2());
	label->setActive(false);
//	label->fadeIn();
	
	float minMenuSizeX = strlen(text)*(text_size-text_size/2);
	if(minMenuSizeX > size[0]) size[0] = minMenuSizeX;
	size[1] = (labels_n+1)*text_size;
	
	gfx->addSceneNode(label, this);
	labels.push_back(label);
	labels_n++;
}