示例#1
0
文件: ai.cpp 项目: dev-riker/ouruo
void PlayerAi::PrintAttributeOnCharacterSheet(TCODConsole &con, Attribute *currAttr, int32_t baseRow, int32_t baseColumn)
{
	con.setDefaultForeground(TCODColor::white);
	con.print(baseColumn, baseRow, "%s:", currAttr->GetName());
	if (currAttr->GetCurrValue() > currAttr->GetBaseValue()) {
		con.setDefaultForeground(TCODColor::green);
	} else if (currAttr->GetCurrValue() < currAttr->GetBaseValue()) {
		con.setDefaultForeground(TCODColor::red);
	}
	con.print(baseColumn + 15, baseRow, "%3d", currAttr->GetCurrValue());
	con.setDefaultForeground(TCODColor::white);
}
示例#2
0
void ALabel::render(TCODConsole &console)
{
  console.setDefaultForeground(_color);
  console.setDefaultBackground(_bgcolor);
  console.printEx(getX(), getY(),
                  TCOD_BKGND_SET,
                  TCOD_LEFT, "%s", _value.c_str());

  if ( _autosize ) setWidth(_value.size());
}