当前位置: 首页>>代码示例>>C++>>正文


C++ IntCoord::size方法代码示例

本文整理汇总了C++中mygui::IntCoord::size方法的典型用法代码示例。如果您正苦于以下问题:C++ IntCoord::size方法的具体用法?C++ IntCoord::size怎么用?C++ IntCoord::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mygui::IntCoord的用法示例。


在下文中一共展示了IntCoord::size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateCoord

	void StateTextureControl::updateCoord()
	{
		MyGUI::UString value;

		if (getCurrentSkin() != nullptr)
			value = getCurrentSkin()->getPropertySet()->getPropertyValue("Coord");

		MyGUI::IntCoord coord;
		if (MyGUI::utility::parseComplex(value, coord.left, coord.top, coord.width, coord.height))
		{
			if (mSizeValue != coord.size())
			{
				mSizeValue = coord.size();
				updateSelectorsSize();
			}
		}
	}
开发者ID:alexis-,项目名称:iwe,代码行数:17,代码来源:StateTextureControl.cpp

示例2: updateCoords

	void IndexTextureController::updateCoords(const std::string& _value)
	{
		MyGUI::IntCoord coord;
		if (MyGUI::utility::parseComplex(_value, coord.left, coord.top, coord.width, coord.height))
			mSize = coord.size();
		else
			mSize.clear();

		updateFrames();
	}
开发者ID:2asoft,项目名称:MMO-Framework,代码行数:10,代码来源:IndexTextureController.cpp

示例3: createSkin

	void TestWindow::createSkin()
	{
		if (mSkinItem == nullptr)
			return;

		MyGUI::IntSize canvasSize = mBackgroundControl->getCanvas()->getSize();

		generateSkin();

		mSkinButton = mBackgroundControl->getCanvas()->createWidget<MyGUI::Button>(mSkinName, MyGUI::IntCoord(0, 0, canvasSize.width, canvasSize.height), MyGUI::Align::Stretch);
		mSkinButton->setFontName(mDefaultFontName);
		mSkinButton->setTextAlign(MyGUI::Align::Center);
		mSkinButton->setCaption("Caption");
		mSkinButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TestWindow::notifyMouseButtonPressed);

		MyGUI::IntCoord coord = mSkinItem->getPropertyValue<MyGUI::IntCoord>("Size");
		MyGUI::IntSize windowSize = coord.size() + mMainWidget->getSize() - canvasSize;
		MyGUI::IntSize parentSize = mMainWidget->getParentSize();

		mMainWidget->setCoord((parentSize.width - windowSize.width) / 2, (parentSize.height - windowSize.height) / 2, windowSize.width, windowSize.height);
	}
开发者ID:chhawk,项目名称:MyGUI,代码行数:21,代码来源:TestWindow.cpp

示例4: 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();
//.........这里部分代码省略.........
开发者ID:siangzhang,项目名称:starworld,代码行数:101,代码来源:ExportManager.cpp

示例5: animate

	size_t WobbleNodeAnimator::animate(
		bool _update,
		size_t _quad_count,
		MyGUI::VectorQuadData& _data,
		float _time,
		MyGUI::IVertexBuffer* _buffer,
		MyGUI::ITexture* _texture,
		const MyGUI::RenderTargetInfo& _info,
		const MyGUI::IntCoord& _coord,
		bool& _isAnimate
		)
	{
		if (mDestroy)
		{
			return _quad_count;
		}

		// проверяем смещения виджета
		if (mOldCoord.empty())
		{
			mOldCoord = _coord;
		}
		else if (mOldCoord.size() != _coord.size() && mOldCoord.point() != _coord.point())
		{
			mInertiaPoint.set(0.5, 0.5);
			mInertiaMode = false;

			addInertia(MyGUI::FloatPoint(_coord.left-mOldCoord.left, _coord.top-mOldCoord.top));
		}
		else if (mOldCoord.size() != _coord.size())
		{
			mInertiaMode = true;

			addInertia(MyGUI::FloatPoint(_coord.width - mOldCoord.width, _coord.height-mOldCoord.height));
		}
		else if (mOldCoord.point() != _coord.point())
		{
			const MyGUI::IntPoint& point = MyGUI::InputManager::getInstance().getMousePosition();
			mInertiaPoint = MyGUI::FloatPoint((float)(point.left - _coord.left) / (float)_coord.width , (float)(point.top - _coord.top) / (float)_coord.height);
			mInertiaMode = false;

			addInertia(MyGUI::FloatPoint(_coord.left-mOldCoord.left, _coord.top-mOldCoord.top));
		}

		mOldCoord = _coord;

		addTime(_time);

		bool anim_update = squaredLength(mDragOffset) >= 0.3f;

		if (!anim_update)
		{
			return _quad_count;
		}

		_isAnimate = true;

		_quad_count = tesselation(
			_quad_count,
			_data,
			_texture,
			_info,
			_coord);

		buildQuadVertex(_data);

		return _quad_count;
	}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:68,代码来源:WobbleNodeAnimator.cpp

示例6: 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());
				}
			}
		}
	}
开发者ID:xzwang2005,项目名称:mygui,代码行数:63,代码来源:SkinExportSerializer.cpp


注:本文中的mygui::IntCoord::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。