Class: Plane

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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(viewport = nil)
  raise "not implemented"

  @viewport = viewport
end

Instance Attribute Details

#bitmapObject

Refers to the Bitmap used in the plane.


5
6
7
# File 'lib/plane.rb', line 5

def bitmap
  @bitmap
end

#blend_typeObject

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

#colorObject

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

#opacityObject

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

#oxObject

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

#oyObject

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

#toneObject

The plane's color Tone.


35
36
37
# File 'lib/plane.rb', line 35

def tone
  @tone
end

#viewportObject (readonly)

Retrieves the Viewport specified when the plane was created.


38
39
40
# File 'lib/plane.rb', line 38

def viewport
  @viewport
end

#visibleObject

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

#zObject

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_xObject

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_yObject

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

#disposeObject

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