Class: LiteRGSS::DisplayWindow
Overview
Class that describe a Window holding the OpenGL context & all drawable
Instance Attribute Summary collapse
-
#height ⇒ Integer
readonly
Get the height of the window.
-
#icon ⇒ Image
writeonly
Set the icon of the window.
-
#openGL_version ⇒ Array<Integer>
readonly
Major & Minor version number of the currently running OpenGL version.
- #settings ⇒ Array(title, width, height, scale, bpp, fps, vsync, fullscreen, visible_mouse)
-
#shader ⇒ Shader
Set the global shader applied to the final content of the window (shader is applied with total pixel size and not native pixel size).
-
#width ⇒ Integer
readonly
Get the width of the window.
-
#x ⇒ Integer
X coordinate of the window on the desktop.
-
#y ⇒ Integer
Y coordinate of the window on the desktop.
Class Method Summary collapse
-
.desktop_height ⇒ Integer
Get the desktop height.
-
.desktop_width ⇒ Integer
Get the desktop width.
-
.list_resolutions ⇒ Array
List all the resolution available on the current device.
-
.max_texture_size ⇒ Integer
Maximum size of the texture for the device the OpenGL context are currently running over.
-
.new(title, width, height, scale, bpp = 32, frame_rate = 60, vsync = false, fullscreen = false, mouse_visible = false)
Create a new DisplayWindow.
Instance Method Summary collapse
-
#dispose
Dispose the window and forcefully close it.
-
#on_closed=(proc)
Define the event called when the on close event is detected.
-
#on_gained_focus=(proc)
Define the event called when the window gains focus.
-
#on_joystick_button_pressed=(proc)
Define the event called when a button is pressed on a joystick.
-
#on_joystick_button_released=(proc)
Define the event called when a button is released on a joystick.
-
#on_joystick_connected=(proc)
Define the event called when a joystick gets plugged in.
-
#on_joystick_disconnected=(proc)
Define the event called when a joystick gets unplugged.
-
#on_joystick_moved=(proc)
Define the event called when a joystick axis is moved.
-
#on_key_pressed=(proc)
Define the event called when a key is pressed.
-
#on_key_released=(proc)
Define the event called when a key is released.
-
#on_lost_focus=(proc)
Define the event called when the window lost focus.
-
#on_mouse_button_pressed=(proc)
Define the event called when a mouse key is pressed.
-
#on_mouse_button_released=(proc)
Define the event called when a mouse key is released.
-
#on_mouse_entered=(proc)
Define the event called when the mouse enters the window.
-
#on_mouse_left=(proc)
Define the event called when the mouse leaves the window.
-
#on_mouse_moved=(proc)
Define the event called when the mouse moves.
-
#on_mouse_wheel_scrolled=(proc)
Define the event called when the mouse wheel is scrolled.
-
#on_resized=(proc)
next true end Define the event called when the resize event is detected.
-
#on_sensor_changed=(proc)
Define the event called when a sensor event was triggered.
-
#on_text_entered=(proc)
Define the event called when a text entry is detected on the window (usally a character representing the UTF-8 pressed key).
-
#on_touch_began=(proc)
Define the event called when a touch event has begun.
-
#on_touch_ended=(proc)
Define the event called when the touche ended.
-
#on_touch_moved=(proc)
Define the event called when the touch moved.
-
#resize_screen(width, height) ⇒ self
Change the window screen size but keep every other parameter in the same settings.
-
#snap_to_bitmap ⇒ Bitmap
Take a snapshot of the window content.
-
#sort_z ⇒ self
Update window internal order according to z of each entities.
-
#update ⇒ self
Update window content & events.
-
#update_no_input ⇒ self
Update the window content.
-
#update_only_input ⇒ self
Update the window event without drawing anything.
Instance Attribute Details
#height ⇒ Integer (readonly)
Returns get the height of the window.
1003 1004 1005 |
# File 'LiteRGSS.rb.yard.rb', line 1003 def height @height end |
#icon=(value) ⇒ Image (writeonly)
Returns Set the icon of the window.
1017 1018 1019 |
# File 'LiteRGSS.rb.yard.rb', line 1017 def icon=(value) @icon = value end |
#openGL_version ⇒ Array<Integer> (readonly)
Returns Major & Minor version number of the currently running OpenGL version.
1032 1033 1034 |
# File 'LiteRGSS.rb.yard.rb', line 1032 def openGL_version @openGL_version end |
#settings ⇒ Array(title, width, height, scale, bpp, fps, vsync, fullscreen, visible_mouse)
1026 1027 1028 |
# File 'LiteRGSS.rb.yard.rb', line 1026 def settings @settings end |
#shader ⇒ Shader
Returns Set the global shader applied to the final content of the window (shader is applied with total pixel size and not native pixel size).
1015 1016 1017 |
# File 'LiteRGSS.rb.yard.rb', line 1015 def shader @shader end |
#width ⇒ Integer (readonly)
Returns get the width of the window.
1001 1002 1003 |
# File 'LiteRGSS.rb.yard.rb', line 1001 def width @width end |
#x ⇒ Integer
Returns X coordinate of the window on the desktop.
1028 1029 1030 |
# File 'LiteRGSS.rb.yard.rb', line 1028 def x @x end |
#y ⇒ Integer
Returns Y coordinate of the window on the desktop.
1030 1031 1032 |
# File 'LiteRGSS.rb.yard.rb', line 1030 def y @y end |
Class Method Details
.desktop_height ⇒ Integer
Get the desktop height
1219 1220 1221 |
# File 'LiteRGSS.rb.yard.rb', line 1219 def self.desktop_height end |
.desktop_width ⇒ Integer
Get the desktop width
1214 1215 1216 |
# File 'LiteRGSS.rb.yard.rb', line 1214 def self.desktop_width end |
.list_resolutions ⇒ Array
List all the resolution available on the current device
1209 1210 1211 |
# File 'LiteRGSS.rb.yard.rb', line 1209 def self.list_resolutions end |
.max_texture_size ⇒ Integer
Maximum size of the texture for the device the OpenGL context are currently running over
966 967 |
# File 'LiteRGSS.rb.yard.rb', line 966 def self.max_texture_size end |
.new(title, width, height, scale, bpp = 32, frame_rate = 60, vsync = false, fullscreen = false, mouse_visible = false)
Create a new DisplayWindow
978 979 980 |
# File 'LiteRGSS.rb.yard.rb', line 978 def self.new(title, width, height, scale, bpp = 32, frame_rate = 60, vsync = false, fullscreen = false, mouse_visible = false) end |
Instance Method Details
#dispose
Dispose the window and forcefully close it
982 983 984 |
# File 'LiteRGSS.rb.yard.rb', line 982 def dispose end |
#on_closed=(proc)
Define the event called when the on close event is detected
1037 1038 1039 |
# File 'LiteRGSS.rb.yard.rb', line 1037 def on_closed=(proc) end |
#on_gained_focus=(proc)
Define the event called when the window gains focus
1064 1065 1066 |
# File 'LiteRGSS.rb.yard.rb', line 1064 def on_gained_focus=(proc) end |
#on_joystick_button_pressed=(proc)
Define the event called when a button is pressed on a joystick
1140 1141 1142 |
# File 'LiteRGSS.rb.yard.rb', line 1140 def (proc) end |
#on_joystick_button_released=(proc)
Define the event called when a button is released on a joystick
1148 1149 1150 |
# File 'LiteRGSS.rb.yard.rb', line 1148 def (proc) end |
#on_joystick_connected=(proc)
Define the event called when a joystick gets plugged in
1164 1165 1166 |
# File 'LiteRGSS.rb.yard.rb', line 1164 def on_joystick_connected=(proc) end |
#on_joystick_disconnected=(proc)
Define the event called when a joystick gets unplugged
1172 1173 1174 |
# File 'LiteRGSS.rb.yard.rb', line 1172 def on_joystick_disconnected=(proc) end |
#on_joystick_moved=(proc)
Define the event called when a joystick axis is moved
1156 1157 1158 |
# File 'LiteRGSS.rb.yard.rb', line 1156 def on_joystick_moved=(proc) end |
#on_key_pressed=(proc)
Define the event called when a key is pressed
1080 1081 1082 |
# File 'LiteRGSS.rb.yard.rb', line 1080 def on_key_pressed=(proc) end |
#on_key_released=(proc)
Define the event called when a key is released
1088 1089 1090 |
# File 'LiteRGSS.rb.yard.rb', line 1088 def on_key_released=(proc) end |
#on_lost_focus=(proc)
Define the event called when the window lost focus
1056 1057 1058 |
# File 'LiteRGSS.rb.yard.rb', line 1056 def on_lost_focus=(proc) end |
#on_mouse_button_pressed=(proc)
Define the event called when a mouse key is pressed
1104 1105 1106 |
# File 'LiteRGSS.rb.yard.rb', line 1104 def (proc) end |
#on_mouse_button_released=(proc)
Define the event called when a mouse key is released
1112 1113 1114 |
# File 'LiteRGSS.rb.yard.rb', line 1112 def (proc) end |
#on_mouse_entered=(proc)
Define the event called when the mouse enters the window
1126 1127 1128 |
# File 'LiteRGSS.rb.yard.rb', line 1126 def on_mouse_entered=(proc) end |
#on_mouse_left=(proc)
Define the event called when the mouse leaves the window
1132 1133 1134 |
# File 'LiteRGSS.rb.yard.rb', line 1132 def on_mouse_left=(proc) end |
#on_mouse_moved=(proc)
Define the event called when the mouse moves
1120 1121 1122 |
# File 'LiteRGSS.rb.yard.rb', line 1120 def on_mouse_moved=(proc) end |
#on_mouse_wheel_scrolled=(proc)
Define the event called when the mouse wheel is scrolled
1096 1097 1098 |
# File 'LiteRGSS.rb.yard.rb', line 1096 def on_mouse_wheel_scrolled=(proc) end |
#on_resized=(proc)
next true
end
Define the event called when the resize event is detected
1048 1049 1050 |
# File 'LiteRGSS.rb.yard.rb', line 1048 def on_resized=(proc) end |
#on_sensor_changed=(proc)
Define the event called when a sensor event was triggered
1204 1205 1206 |
# File 'LiteRGSS.rb.yard.rb', line 1204 def on_sensor_changed=(proc) end |
#on_text_entered=(proc)
Define the event called when a text entry is detected on the window (usally a character representing the UTF-8 pressed key)
1072 1073 1074 |
# File 'LiteRGSS.rb.yard.rb', line 1072 def on_text_entered=(proc) end |
#on_touch_began=(proc)
Define the event called when a touch event has begun
1180 1181 1182 |
# File 'LiteRGSS.rb.yard.rb', line 1180 def on_touch_began=(proc) end |
#on_touch_ended=(proc)
Define the event called when the touche ended
1196 1197 1198 |
# File 'LiteRGSS.rb.yard.rb', line 1196 def on_touch_ended=(proc) end |
#on_touch_moved=(proc)
Define the event called when the touch moved
1188 1189 1190 |
# File 'LiteRGSS.rb.yard.rb', line 1188 def on_touch_moved=(proc) end |
#resize_screen(width, height) ⇒ self
Change the window screen size but keep every other parameter in the same settings
1022 1023 1024 |
# File 'LiteRGSS.rb.yard.rb', line 1022 def resize_screen(width, height) end |
#snap_to_bitmap ⇒ Bitmap
Take a snapshot of the window content
997 998 999 |
# File 'LiteRGSS.rb.yard.rb', line 997 def snap_to_bitmap end |
#sort_z ⇒ self
Update window internal order according to z of each entities
992 993 994 |
# File 'LiteRGSS.rb.yard.rb', line 992 def sort_z end |
#update ⇒ self
Update window content & events. This method might wait for vsync before updating events
987 988 989 |
# File 'LiteRGSS.rb.yard.rb', line 987 def update end |
#update_no_input ⇒ self
Update the window content. This method might wait for vsync before returning
1006 1007 1008 |
# File 'LiteRGSS.rb.yard.rb', line 1006 def update_no_input end |
#update_only_input ⇒ self
Update the window event without drawing anything.
1011 1012 1013 |
# File 'LiteRGSS.rb.yard.rb', line 1011 def update_only_input end |