supertux
tilemap.hpp
1 // SuperTux
2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_SCRIPTING_TILEMAP_HPP
18 #define HEADER_SUPERTUX_SCRIPTING_TILEMAP_HPP
19 
20 #ifndef SCRIPTING_API
21 #include "scripting/game_object.hpp"
22 
23 class TileMap;
24 #endif
25 
26 namespace scripting {
27 
28 class TileMap final
29 #ifndef SCRIPTING_API
30  : public GameObject<::TileMap>
31 #endif
32 {
33 public:
34 #ifndef SCRIPTING_API
35 public:
36  using GameObject::GameObject;
37 private:
38  TileMap(const TileMap&) = delete;
39  TileMap& operator=(const TileMap&) = delete;
40 #endif
41 
42 public:
44  void goto_node(int node_no);
45 
47  void start_moving();
48 
50  void stop_moving();
51 
53  int get_tile_id(int x, int y) const;
54 
56  int get_tile_id_at(float x, float y) const;
57 
59  void change(int x, int y, int newtile);
60 
62  void change_at(float x, float y, int newtile);
63 
68  void fade(float alpha, float seconds);
69 
74  void tint_fade(float seconds, float red, float green, float blue, float alpha);
75 
79  void set_alpha(float alpha);
80 
84  float get_alpha() const;
85 
90  void set_solid(bool solid);
91 };
92 
93 } // namespace scripting
94 
95 #endif
96 
97 /* EOF */
void goto_node(int node_no)
Move tilemap until at given node, then stop.
Definition: tilemap.cpp:23
WARNING: This file is automatically generated from: &#39;src/scripting/wrapper.interface.hpp&#39; DO NOT CHANGE.
Definition: ambient_sound.cpp:21
Definition: game_object.hpp:60
void stop_moving()
Stop tilemap at next node.
Definition: tilemap.cpp:37
int get_tile_id(int x, int y) const
returns tile ID in row y and column y (of the tilemap)
Definition: tilemap.cpp:44
void start_moving()
Start moving tilemap.
Definition: tilemap.cpp:30
void set_alpha(float alpha)
Instantly switch tilemap&#39;s opacity to alpha.
Definition: tilemap.cpp:86
void set_solid(bool solid)
Switch tilemap&#39;s real solidity to the given bool.
Definition: tilemap.cpp:100
void change_at(float x, float y, int newtile)
replaces the tile by given tile at position pos (in world coordinates)
Definition: tilemap.cpp:65
float get_alpha() const
Return tilemap&#39;s opacity.
Definition: tilemap.cpp:93
int get_tile_id_at(float x, float y) const
returns tile ID at position pos (in world coordinates)
Definition: tilemap.cpp:51
void tint_fade(float seconds, float red, float green, float blue, float alpha)
Start fading the tilemap to tint given by RGBA.
Definition: tilemap.cpp:79
This class is responsible for drawing the level tiles.
Definition: tilemap.hpp:39
void fade(float alpha, float seconds)
Start fading the tilemap to opacity given by alpha.
Definition: tilemap.cpp:72
Definition: tilemap.hpp:28
void change(int x, int y, int newtile)
replaces the tile by given tile in row y and column y (of the tilemap)
Definition: tilemap.cpp:58