Class: Plane
- Inherits:
-
Object
- Object
- Plane
- Defined in:
- lib/plane.rb
Overview
The Plane class. Planes are special sprites that tile bitmap patterns across the entire screen, and are used to display panoramas and fog.
Instance Attribute Summary collapse
-
#bitmap ⇒ Object
Refers to the Bitmap used in the plane.
-
#blend_type ⇒ Object
The plane’s blending mode (0: normal, 1: addition, 2: subtraction).
-
#color ⇒ Object
The Color to be blended with the plane.
-
#opacity ⇒ Object
The plane’s opacity (0-255).
-
#ox ⇒ Object
The X-coordinate of the plane’s starting point.
-
#oy ⇒ Object
The Y-coordinate of the plane’s starting point.
-
#tone ⇒ Object
The plane’s color Tone.
-
#viewport ⇒ Object
readonly
Retrieves the Viewport specified when the plane was created.
-
#visible ⇒ Object
Whether the plane can be seen.
-
#z ⇒ Object
The plane’s Z-coordinate.
-
#zoom_x ⇒ Object
The plane’s X-axis zoom level.
-
#zoom_y ⇒ Object
The plane’s Y-axis zoom level.
Instance Method Summary collapse
-
#dispose ⇒ Object
Frees the plane.
-
#disposed? ⇒ Boolean
Returns TRUE if the plane has been freed.
-
#initialize(viewport = nil) ⇒ Plane
constructor
Creates a Plane object.
Constructor Details
#initialize(viewport = nil) ⇒ Plane
Creates a Plane object. Specifies a Viewport (Viewport) when necessary.
41 42 43 44 45 |
# File 'lib/plane.rb', line 41 def initialize( = nil) raise "not implemented" @viewport = end |
Instance Attribute Details
#bitmap ⇒ Object
Refers to the Bitmap used in the plane.
5 6 7 |
# File 'lib/plane.rb', line 5 def bitmap @bitmap end |
#blend_type ⇒ Object
The plane’s blending mode (0: normal, 1: addition, 2: subtraction).
29 30 31 |
# File 'lib/plane.rb', line 29 def blend_type @blend_type end |
#color ⇒ Object
The Color to be blended with the plane. Alpha values are used in the blending ratio.
32 33 34 |
# File 'lib/plane.rb', line 32 def color @color end |
#opacity ⇒ Object
The plane’s opacity (0-255). Values out of range are automatically corrected.
26 27 28 |
# File 'lib/plane.rb', line 26 def opacity @opacity end |
#ox ⇒ Object
The X-coordinate of the plane’s starting point. Change this value to scroll the plane.
14 15 16 |
# File 'lib/plane.rb', line 14 def ox @ox end |
#oy ⇒ Object
The Y-coordinate of the plane’s starting point. Change this value to scroll the plane.
17 18 19 |
# File 'lib/plane.rb', line 17 def oy @oy end |
#viewport ⇒ Object (readonly)
Retrieves the Viewport specified when the plane was created.
38 39 40 |
# File 'lib/plane.rb', line 38 def @viewport end |
#visible ⇒ Object
Whether the plane can be seen. If TRUE, the plane is visible.
8 9 10 |
# File 'lib/plane.rb', line 8 def visible @visible end |
#z ⇒ Object
The plane’s Z-coordinate. The larger this value, the closer to the player the plane will be displayed. If multiple objects share the same Z-coordinate, the more recently created object will be displayed closest to the player.
11 12 13 |
# File 'lib/plane.rb', line 11 def z @z end |
#zoom_x ⇒ Object
The plane’s X-axis zoom level. 1.0 denotes actual pixel size.
20 21 22 |
# File 'lib/plane.rb', line 20 def zoom_x @zoom_x end |
#zoom_y ⇒ Object
The plane’s Y-axis zoom level. 1.0 denotes actual pixel size.
23 24 25 |
# File 'lib/plane.rb', line 23 def zoom_y @zoom_y end |
Instance Method Details
#dispose ⇒ Object
Frees the plane. If the plane has already been freed, does nothing.
48 49 50 51 52 |
# File 'lib/plane.rb', line 48 def dispose raise "not implemented" @disposed = true end |
#disposed? ⇒ Boolean
Returns TRUE if the plane has been freed.
55 56 57 |
# File 'lib/plane.rb', line 55 def disposed? @disposed end |