MyGUI
3.2.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
mygui
MyGUIEngine
src
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
"
8
#include "
MyGUI_ResourceManualPointer.h
"
9
#include "
MyGUI_ImageBox.h
"
10
#include "
MyGUI_CoordConverter.h
"
11
#include "
MyGUI_TextureUtility.h
"
12
13
namespace
MyGUI
14
{
15
16
ResourceManualPointer::ResourceManualPointer
()
17
{
18
}
19
20
ResourceManualPointer::~ResourceManualPointer
()
21
{
22
}
23
24
void
ResourceManualPointer::deserialization
(
xml::ElementPtr
_node,
Version
_version)
25
{
26
Base::deserialization(_node, _version);
27
28
// берем детей и крутимся, основной цикл
29
xml::ElementEnumerator
info = _node->
getElementEnumerator
();
30
while
(info.
next
(
"Property"
))
31
{
32
const
std::string& key = info->
findAttribute
(
"key"
);
33
const
std::string& value = info->
findAttribute
(
"value"
);
34
35
if
(key ==
"Point"
) mPoint =
IntPoint::parse
(value);
36
else
if
(key ==
"Size"
) mSize =
IntSize::parse
(value);
37
else
if
(key ==
"Texture"
) mTexture = value;
38
else
if
(key ==
"Coord"
) mTextureCoord =
IntCoord::parse
(value);
39
}
40
}
41
42
void
ResourceManualPointer::setImage
(
ImageBox
* _image)
43
{
44
_image->
deleteAllItems
();
45
_image->
setImageInfo
(mTexture, mTextureCoord, mTextureCoord.
size
());
46
}
47
48
void
ResourceManualPointer::setPosition
(
ImageBox
* _image,
const
IntPoint
& _point)
49
{
50
_image->
setCoord
(_point.
left
- mPoint.
left
, _point.
top
- mPoint.
top
, mSize.
width
, mSize.
height
);
51
}
52
53
}
// namespace MyGUI
Generated on Wed Aug 20 2014 00:03:33 for MyGUI by
1.8.3.1