Class: Window
- Inherits:
-
Object
- Object
- Window
- Defined in:
- lib/window.rb
Overview
The game window class. Created internally from multiple sprites.
Instance Attribute Summary collapse
-
#active ⇒ Object
Cursor blink status.
-
#back_opacity ⇒ Object
The window background’s opacity (0-255).
-
#contents ⇒ Object
Refers to the Bitmap used for the window’s contents.
-
#contents_opacity ⇒ Object
The opacity of the window’s contents (0-255).
-
#cursor_rect ⇒ Object
The cursor box (Rect).
-
#height ⇒ Object
The window’s height.
-
#opacity ⇒ Object
The window’s opacity (0-255).
-
#ox ⇒ Object
The X-coordinate of the starting point of the window’s contents.
-
#oy ⇒ Object
The Y-coordinate of the starting point of the window’s contents.
-
#pause ⇒ Object
The pause graphic’s visibility.
-
#stretch ⇒ Object
The wallpaper display method.
-
#viewport ⇒ Object
readonly
Gets the Viewport specified when the window was created.
-
#visible ⇒ Object
The window’s visibility.
-
#width ⇒ Object
The window’s width.
-
#windowskin ⇒ Object
Refers to the Bitmap used as a windowskin.
-
#x ⇒ Object
The window’s X-coordinate.
-
#y ⇒ Object
The window’s Y-coordinate.
-
#z ⇒ Object
The window’s Z-coordinate.
Instance Method Summary collapse
-
#dispose ⇒ Object
Frees the window.
-
#disposed? ⇒ Boolean
Returns TRUE if the window has been freed.
-
#initialize(viewport = nil) ⇒ Window
constructor
A new instance of Window.
-
#update ⇒ Object
Refreshes the cursor blink and the pause graphic animation.
Constructor Details
#initialize(viewport = nil) ⇒ Window
Returns a new instance of Window.
74 75 76 77 78 |
# File 'lib/window.rb', line 74 def initialize( = nil) raise "not implemented" @viewport = end |
Instance Attribute Details
#active ⇒ Object
Cursor blink status. If TRUE, the cursor is blinking.
21 22 23 |
# File 'lib/window.rb', line 21 def active @active end |
#back_opacity ⇒ Object
The window background’s opacity (0-255). Values out of range are automatically corrected.
64 65 66 |
# File 'lib/window.rb', line 64 def back_opacity @back_opacity end |
#contents ⇒ Object
Refers to the Bitmap used for the window’s contents.
9 10 11 |
# File 'lib/window.rb', line 9 def contents @contents end |
#contents_opacity ⇒ Object
The opacity of the window’s contents (0-255). Values out of range are automatically corrected.
68 69 70 |
# File 'lib/window.rb', line 68 def contents_opacity @contents_opacity end |
#cursor_rect ⇒ Object
The cursor box (Rect). Sets the window’s upper left corner using relative coordinates (-16, -16).
18 19 20 |
# File 'lib/window.rb', line 18 def cursor_rect @cursor_rect end |
#height ⇒ Object
The window’s height.
41 42 43 |
# File 'lib/window.rb', line 41 def height @height end |
#opacity ⇒ Object
The window’s opacity (0-255). Values out of range are automatically corrected.
60 61 62 |
# File 'lib/window.rb', line 60 def opacity @opacity end |
#ox ⇒ Object
The X-coordinate of the starting point of the window’s contents. Change this value to scroll the window’s contents.
52 53 54 |
# File 'lib/window.rb', line 52 def ox @ox end |
#oy ⇒ Object
The Y-coordinate of the starting point of the window’s contents. Change this value to scroll the window’s contents.
56 57 58 |
# File 'lib/window.rb', line 56 def oy @oy end |
#pause ⇒ Object
The pause graphic’s visibility. This is a symbol that appears in the message window when waiting for the player to press a button. If TRUE, the graphic is visible.
29 30 31 |
# File 'lib/window.rb', line 29 def pause @pause end |
#stretch ⇒ Object
The wallpaper display method. If TRUE, stretches the wallpaper graphic; if FALSE, tiles it. The default value is TRUE.
13 14 15 |
# File 'lib/window.rb', line 13 def stretch @stretch end |
#viewport ⇒ Object (readonly)
Gets the Viewport specified when the window was created.
72 73 74 |
# File 'lib/window.rb', line 72 def @viewport end |
#visible ⇒ Object
The window’s visibility. If TRUE, the window is visible.
24 25 26 |
# File 'lib/window.rb', line 24 def visible @visible end |
#width ⇒ Object
The window’s width.
38 39 40 |
# File 'lib/window.rb', line 38 def width @width end |
#windowskin ⇒ Object
Refers to the Bitmap used as a windowskin.
5 6 7 |
# File 'lib/window.rb', line 5 def windowskin @windowskin end |
#x ⇒ Object
The window’s X-coordinate.
32 33 34 |
# File 'lib/window.rb', line 32 def x @x end |
#y ⇒ Object
The window’s Y-coordinate.
35 36 37 |
# File 'lib/window.rb', line 35 def y @y end |
#z ⇒ Object
The window’s Z-coordinate. The larger this value, the closer to the player the window will be displayed. If multiple objects share the same Z-coordinate, the more recently created object will be displayed closest to the player. The Z-coordinate of the window’s contents equals the window background’s Z-coordinate plus 2.
48 49 50 |
# File 'lib/window.rb', line 48 def z @z end |
Instance Method Details
#dispose ⇒ Object
Frees the window. If the window has already been freed, does nothing.
81 82 83 84 85 |
# File 'lib/window.rb', line 81 def dispose raise "not implemented" @disposed = true end |
#disposed? ⇒ Boolean
Returns TRUE if the window has been freed.
88 89 90 |
# File 'lib/window.rb', line 88 def disposed? @disposed end |
#update ⇒ Object
Refreshes the cursor blink and the pause graphic animation. As a rule, this method is called once per frame.
94 95 96 |
# File 'lib/window.rb', line 94 def update raise "not implemented" end |