本文整理汇总了C++中mygui::IntCoord::print方法的典型用法代码示例。如果您正苦于以下问题:C++ IntCoord::print方法的具体用法?C++ IntCoord::print怎么用?C++ IntCoord::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::IntCoord
的用法示例。
在下文中一共展示了IntCoord::print方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeState
pugi::xml_node SkinExportSerializer::writeState(pugi::xml_node _parent, DataPtr _data, const MyGUI::IntCoord& _value)
{
MyGUI::IntPoint point = MyGUI::IntPoint::parse(_data->getPropertyValue("Point"));
MyGUI::IntCoord coord = _value + point;
pugi::xml_node node = _parent.append_child("State");
node.append_attribute("name").set_value(convertEditorToExportStateName(_data->getPropertyValue("Name")).c_str());
node.append_attribute("offset").set_value(coord.print().c_str());
return node;
}
示例2: convertSkin
void ExportManager::convertSkin(MyGUI::xml::Element* _from, MyGUI::xml::Element* _to)
{
_to->addAttribute("type", "ResourceSkin");
_to->addAttribute("name", _from->findAttribute("name"));
MyGUI::xml::ElementEnumerator nodes = _from->getElementEnumerator();
while (nodes.next())
{
MyGUI::UString coordValue;
MyGUI::UString textureValue;
MyGUI::xml::Element* node = nodes.current();
if (node->getName() == "PropertySet")
{
MyGUI::xml::ElementEnumerator propertyNodes = node->getElementEnumerator();
while (propertyNodes.next("Property"))
{
MyGUI::xml::Element* propertyNode = propertyNodes.current();
std::string name;
if (propertyNode->findAttribute("name", name))
{
if (name == "Coord")
{
MyGUI::IntCoord coord = MyGUI::IntCoord::parse(propertyNode->getContent());
coordValue = coord.size().print();
}
else if (name == "Texture")
{
textureValue = propertyNode->getContent();
}
}
}
_to->addAttribute("size", coordValue);
_to->addAttribute("texture", textureValue);
break;
}
else if (node->getName() == "RegionItem")
{
bool regionVisible = true;
MyGUI::xml::ElementEnumerator regionNodes = node->getElementEnumerator();
while (regionNodes.next("PropertySet"))
{
MyGUI::xml::ElementEnumerator propertyNodes = regionNodes->getElementEnumerator();
while (propertyNodes.next("Property"))
{
MyGUI::xml::Element* propertyNode = propertyNodes.current();
std::string name;
if (propertyNode->findAttribute("name", name))
{
if (name == "Visible")
{
if (propertyNode->getContent() != "True")
regionVisible = false;
}
else if (name == "Enabled")
{
if (propertyNode->getContent() != "True")
regionVisible = false;
}
}
}
break;
}
if (!regionVisible)
continue;
MyGUI::xml::Element* region = _to->createChild("BasisSkin");
MyGUI::IntCoord regionCoord;
MyGUI::UString regionTypeValue;
MyGUI::UString regionOffsetValue;
MyGUI::UString alignValue;
regionNodes = node->getElementEnumerator();
while (regionNodes.next("PropertySet"))
{
MyGUI::xml::ElementEnumerator regionPropertyNode = regionNodes->getElementEnumerator();
while (regionPropertyNode.next("Property"))
{
std::string name;
if (regionPropertyNode->findAttribute("name", name))
{
if (name == "RegionType")
{
regionTypeValue = regionPropertyNode->getContent();
}
else if (name == "Position")
{
regionCoord = MyGUI::IntCoord::parse(regionPropertyNode->getContent());
regionOffsetValue = regionCoord.print();
}
else if (name == "Align")
{
alignValue = regionPropertyNode->getContent();
//.........这里部分代码省略.........
示例3: writeRegion
void SkinExportSerializer::writeRegion(pugi::xml_node _parent, DataPtr _parentData, DataPtr _data, bool _text)
{
bool isVisible = MyGUI::utility::parseValue<bool>(_data->getPropertyValue("Visible")) &&
MyGUI::utility::parseValue<bool>(_data->getPropertyValue("Enable"));
if (!isVisible)
return;
MyGUI::IntCoord coord = MyGUI::IntCoord::parse(_data->getPropertyValue("Coord"));
std::string type = _data->getPropertyValue("Type");
bool tileVert = true;
bool tileHorz = true;
if (type == "TileRect Vert")
{
type = "TileRect";
tileHorz = false;
}
else if (type == "TileRect Horz")
{
type = "TileRect";
tileVert = false;
}
pugi::xml_node node = _parent.append_child("BasisSkin");
node.append_attribute("type").set_value(type.c_str());
node.append_attribute("offset").set_value(coord.print().c_str());
node.append_attribute("align").set_value(convertEditorToExportAlign(_data->getPropertyValue("Name")).c_str());
for (Data::VectorData::const_iterator child = _parentData->getChilds().begin(); child != _parentData->getChilds().end(); child ++)
{
if ((*child)->getType()->getName() != "State")
continue;
bool visible = MyGUI::utility::parseValue<bool>((*child)->getPropertyValue("Visible"));
if (!visible)
continue;
if (_text)
{
writeStateText(node, (*child), coord);
}
else
{
pugi::xml_node stateNode = writeState(node, (*child), coord);
if (type == "TileRect")
{
pugi::xml_node propertyNode = stateNode.append_child("Property");
propertyNode.append_attribute("key").set_value("TileSize");
propertyNode.append_attribute("value").set_value(coord.size().print().c_str());
propertyNode = stateNode.append_child("Property");
propertyNode.append_attribute("key").set_value("TileH");
propertyNode.append_attribute("value").set_value(MyGUI::utility::toString(tileHorz).c_str());
propertyNode = stateNode.append_child("Property");
propertyNode.append_attribute("key").set_value("TileV");
propertyNode.append_attribute("value").set_value(MyGUI::utility::toString(tileVert).c_str());
}
}
}
}