diff options
| author | hurikhan | 2015-01-11 15:47:27 +0800 |
|---|---|---|
| committer | hurikhan | 2015-01-11 15:47:27 +0800 |
| commit | ac558c15eaeb45b3e7ae2604e26ca1dffb60b779 (patch) | |
| tree | 2f46fa9ed27ea108717fc151e8635c6471213428 /core | |
| parent | 291d7992ceae487a63dc2d6eb1ee2da7312017c5 (diff) | |
| download | godot-ac558c15eaeb45b3e7ae2604e26ca1dffb60b779.tar.gz godot-ac558c15eaeb45b3e7ae2604e26ca1dffb60b779.tar.zst godot-ac558c15eaeb45b3e7ae2604e26ca1dffb60b779.zip | |
get_window_position() + set_window_position() added
Diffstat (limited to 'core')
| -rw-r--r-- | core/bind/core_bind.cpp | 10 | ||||
| -rw-r--r-- | core/bind/core_bind.h | 2 | ||||
| -rw-r--r-- | core/os/os.h | 7 |
3 files changed, 16 insertions, 3 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 62d93745a..3109b8bc8 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -176,6 +176,14 @@ bool _OS::is_video_mode_fullscreen(int p_screen) const { } +Point2 _OS::get_window_position() const { + return OS::get_singleton()->get_window_position(); +} + +void _OS::set_window_position(const Point2& p_position) { + OS::get_singleton()->set_window_position(p_position); +} + void _OS::set_fullscreen(bool p_enabled,int p_screen) { OS::get_singleton()->set_fullscreen(p_enabled, p_screen); } @@ -641,6 +649,8 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); //MSC + ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); + ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position); ObjectTypeDB::bind_method(_MD("set_fullscreen","enabled","screen"),&_OS::set_fullscreen,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("is_fullscreen"),&_OS::is_fullscreen); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index fedd03c3a..92056aa0d 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -109,6 +109,8 @@ public: Array get_fullscreen_mode_list(int p_screen=0) const; //MSC + virtual Point2 get_window_position() const; + virtual void set_window_position(const Point2& p_position); void set_fullscreen(bool p_enabled, int p_screen=0); bool is_fullscreen() const; diff --git a/core/os/os.h b/core/os/os.h index 9de2e3556..9089e7de7 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -69,12 +69,11 @@ public: }; struct VideoMode { - int x,y,width,height; + int width,height; bool fullscreen; bool resizable; float get_aspect() const { return (float)width/(float)height; } - VideoMode(int p_x=0, int p_y=0,int p_width=640,int p_height=480,bool p_fullscreen=false, bool p_resizable = true) - { x=p_x; y=p_y; width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; } + VideoMode(int p_width=640,int p_height=480,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; } }; protected: friend class Main; @@ -152,6 +151,8 @@ public: virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const=0; //MSC + virtual Point2 get_window_position() const=0; + virtual void set_window_position(const Point2& p_position)=0; virtual void set_fullscreen(bool p_enabled,int p_screen=0)=0; virtual bool is_fullscreen() const=0; |
