tmxparser  2.1.0
 All Classes Functions Variables Pages
TmxTileOffset.h
1 //-----------------------------------------------------------------------------
2 // TmxTileOffset.h
3 //
4 // Copyright (c) 2010-2014, Tamir Atias
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL TAMIR ATIAS BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Author: Tamir Atias
27 //-----------------------------------------------------------------------------
28 #pragma once
29 
30 #include <string>
31 
32 namespace tinyxml2 {
33  class XMLNode;
34 }
35 
36 namespace Tmx
37 {
38  //-------------------------------------------------------------------------
42  //-------------------------------------------------------------------------
43  class TileOffset
44  {
45  public:
46  TileOffset();
47  ~TileOffset();
48 
50  void Parse(const tinyxml2::XMLNode *tileOffsetNode);
51 
53  int GetX() const { return x; }
54 
56  int GetY() const { return y; }
57 
58  private:
59  int x;
60  int y;
61  };
62 }
int GetY() const
Get the value of the y attribute of the tile offset. Vertical offset in pixels (positive is down)...
Definition: TmxTileOffset.h:56
A class used for used to specify an offset in pixels, to be applied when drawing a tile from the rela...
Definition: TmxTileOffset.h:43
void Parse(const tinyxml2::XMLNode *tileOffsetNode)
Parses a tileoffset element.
Definition: TmxTileOffset.cpp:42
int GetX() const
Get the value of the x attribute of the tile offset. Horizontal offset in pixels. ...
Definition: TmxTileOffset.h:53