MyGUI 3.4.3
MyGUI_ResourceManualPointer.cpp
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#include "MyGUI_Precompiled.h"
9#include "MyGUI_ImageBox.h"
12
13namespace MyGUI
14{
15
17 {
18 Base::deserialization(_node, _version);
19
20 // берем детей и крутимся, основной цикл
22 while (info.next("Property"))
23 {
24 std::string_view key = info->findAttribute("key");
25 std::string_view value = info->findAttribute("value");
26
27 if (key == "Point")
28 mPoint = IntPoint::parse(value);
29 else if (key == "Size")
30 mSize = IntSize::parse(value);
31 else if (key == "Texture")
32 mTexture = value;
33 else if (key == "Coord")
34 mTextureCoord = IntCoord::parse(value);
35 }
36 }
37
39 {
40 _image->deleteAllItems();
41 _image->setImageInfo(mTexture, mTextureCoord, mTextureCoord.size());
42 }
43
45 {
46 _image->setCoord(_point.left - mPoint.left, _point.top - mPoint.top, mSize.width, mSize.height);
47 }
48
49} // namespace MyGUI
widget description should be here.
void setImageInfo(std::string_view _texture, const IntCoord &_coord, const IntSize &_tile)
void deleteAllItems()
Delete all items.
void deserialization(xml::ElementPtr _node, Version _version) override
void setImage(ImageBox *_image) override
void setPosition(ImageBox *_image, const IntPoint &_point) override
void setCoord(const IntCoord &_coord) override
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
Element * ElementPtr
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
static TCoord< int > parse(std::string_view _value)
static TPoint< int > parse(std::string_view _value)
static TSize< int > parse(std::string_view _value)