Class: LiteRGSS::DisplayWindow
Overview
Class that describe a Window holding the OpenGL context & all drawable
Constant Summary collapse
- MAX_TEXTURE_SIZE =
Maximum size of the texture for the device the OpenGL context are currently running over
1024
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.
-
.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.
1001 1002 1003 |
# File 'LiteRGSS.rb.yard.rb', line 1001 def height @height end |
#icon=(value) ⇒ Image (writeonly)
Returns Set the icon of the window.
1015 1016 1017 |
# File 'LiteRGSS.rb.yard.rb', line 1015 def icon=(value) @icon = value end |
#openGL_version ⇒ Array<Integer> (readonly)
Returns Major & Minor version number of the currently running OpenGL version.
1030 1031 1032 |
# File 'LiteRGSS.rb.yard.rb', line 1030 def openGL_version @openGL_version end |
#settings ⇒ Array(title, width, height, scale, bpp, fps, vsync, fullscreen, visible_mouse)
1024 1025 1026 |
# File 'LiteRGSS.rb.yard.rb', line 1024 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).
1013 1014 1015 |
# File 'LiteRGSS.rb.yard.rb', line 1013 def shader @shader end |
#width ⇒ Integer (readonly)
Returns get the width of the window.
999 1000 1001 |
# File 'LiteRGSS.rb.yard.rb', line 999 def width @width end |
#x ⇒ Integer
Returns X coordinate of the window on the desktop.
1026 1027 1028 |
# File 'LiteRGSS.rb.yard.rb', line 1026 def x @x end |
#y ⇒ Integer
Returns Y coordinate of the window on the desktop.
1028 1029 1030 |
# File 'LiteRGSS.rb.yard.rb', line 1028 def y @y end |
Class Method Details
.desktop_height ⇒ Integer
Get the desktop height
1217 1218 1219 |
# File 'LiteRGSS.rb.yard.rb', line 1217 def self.desktop_height end |
.desktop_width ⇒ Integer
Get the desktop width
1212 1213 1214 |
# File 'LiteRGSS.rb.yard.rb', line 1212 def self.desktop_width end |
.list_resolutions ⇒ Array
List all the resolution available on the current device
1207 1208 1209 |
# File 'LiteRGSS.rb.yard.rb', line 1207 def self.list_resolutions end |
.new(title, width, height, scale, bpp = 32, frame_rate = 60, vsync = false, fullscreen = false, mouse_visible = false)
Create a new DisplayWindow
976 977 978 |
# File 'LiteRGSS.rb.yard.rb', line 976 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
980 981 982 |
# File 'LiteRGSS.rb.yard.rb', line 980 def dispose end |
#on_closed=(proc)
Define the event called when the on close event is detected
1035 1036 1037 |
# File 'LiteRGSS.rb.yard.rb', line 1035 def on_closed=(proc) end |
#on_gained_focus=(proc)
Define the event called when the window gains focus
1062 1063 1064 |
# File 'LiteRGSS.rb.yard.rb', line 1062 def on_gained_focus=(proc) end |
#on_joystick_button_pressed=(proc)
Define the event called when a button is pressed on a joystick
1138 1139 1140 |
# File 'LiteRGSS.rb.yard.rb', line 1138 def (proc) end |
#on_joystick_button_released=(proc)
Define the event called when a button is released on a joystick
1146 1147 1148 |
# File 'LiteRGSS.rb.yard.rb', line 1146 def (proc) end |
#on_joystick_connected=(proc)
Define the event called when a joystick gets plugged in
1162 1163 1164 |
# File 'LiteRGSS.rb.yard.rb', line 1162 def on_joystick_connected=(proc) end |
#on_joystick_disconnected=(proc)
Define the event called when a joystick gets unplugged
1170 1171 1172 |
# File 'LiteRGSS.rb.yard.rb', line 1170 def on_joystick_disconnected=(proc) end |
#on_joystick_moved=(proc)
Define the event called when a joystick axis is moved
1154 1155 1156 |
# File 'LiteRGSS.rb.yard.rb', line 1154 def on_joystick_moved=(proc) end |
#on_key_pressed=(proc)
Define the event called when a key is pressed
1078 1079 1080 |
# File 'LiteRGSS.rb.yard.rb', line 1078 def on_key_pressed=(proc) end |
#on_key_released=(proc)
Define the event called when a key is released
1086 1087 1088 |
# File 'LiteRGSS.rb.yard.rb', line 1086 def on_key_released=(proc) end |
#on_lost_focus=(proc)
Define the event called when the window lost focus
1054 1055 1056 |
# File 'LiteRGSS.rb.yard.rb', line 1054 def on_lost_focus=(proc) end |
#on_mouse_button_pressed=(proc)
Define the event called when a mouse key is pressed
1102 1103 1104 |
# File 'LiteRGSS.rb.yard.rb', line 1102 def (proc) end |
#on_mouse_button_released=(proc)
Define the event called when a mouse key is released
1110 1111 1112 |
# File 'LiteRGSS.rb.yard.rb', line 1110 def (proc) end |
#on_mouse_entered=(proc)
Define the event called when the mouse enters the window
1124 1125 1126 |
# File 'LiteRGSS.rb.yard.rb', line 1124 def on_mouse_entered=(proc) end |
#on_mouse_left=(proc)
Define the event called when the mouse leaves the window
1130 1131 1132 |
# File 'LiteRGSS.rb.yard.rb', line 1130 def on_mouse_left=(proc) end |
#on_mouse_moved=(proc)
Define the event called when the mouse moves
1118 1119 1120 |
# File 'LiteRGSS.rb.yard.rb', line 1118 def on_mouse_moved=(proc) end |
#on_mouse_wheel_scrolled=(proc)
Define the event called when the mouse wheel is scrolled
1094 1095 1096 |
# File 'LiteRGSS.rb.yard.rb', line 1094 def on_mouse_wheel_scrolled=(proc) end |
#on_resized=(proc)
next true
end
Define the event called when the resize event is detected
1046 1047 1048 |
# File 'LiteRGSS.rb.yard.rb', line 1046 def on_resized=(proc) end |
#on_sensor_changed=(proc)
Define the event called when a sensor event was triggered
1202 1203 1204 |
# File 'LiteRGSS.rb.yard.rb', line 1202 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)
1070 1071 1072 |
# File 'LiteRGSS.rb.yard.rb', line 1070 def on_text_entered=(proc) end |
#on_touch_began=(proc)
Define the event called when a touch event has begun
1178 1179 1180 |
# File 'LiteRGSS.rb.yard.rb', line 1178 def on_touch_began=(proc) end |
#on_touch_ended=(proc)
Define the event called when the touche ended
1194 1195 1196 |
# File 'LiteRGSS.rb.yard.rb', line 1194 def on_touch_ended=(proc) end |
#on_touch_moved=(proc)
Define the event called when the touch moved
1186 1187 1188 |
# File 'LiteRGSS.rb.yard.rb', line 1186 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
1020 1021 1022 |
# File 'LiteRGSS.rb.yard.rb', line 1020 def resize_screen(width, height) end |
#snap_to_bitmap ⇒ Bitmap
Take a snapshot of the window content
995 996 997 |
# File 'LiteRGSS.rb.yard.rb', line 995 def snap_to_bitmap end |
#sort_z ⇒ self
Update window internal order according to z of each entities
990 991 992 |
# File 'LiteRGSS.rb.yard.rb', line 990 def sort_z end |
#update ⇒ self
Update window content & events. This method might wait for vsync before updating events
985 986 987 |
# File 'LiteRGSS.rb.yard.rb', line 985 def update end |
#update_no_input ⇒ self
Update the window content. This method might wait for vsync before returning
1004 1005 1006 |
# File 'LiteRGSS.rb.yard.rb', line 1004 def update_no_input end |
#update_only_input ⇒ self
Update the window event without drawing anything.
1009 1010 1011 |
# File 'LiteRGSS.rb.yard.rb', line 1009 def update_only_input end |