Module: RGSS3::Container

Included in:
Plane, Sprite
Defined in:
lib/rgss3/container.rb

Overview

common methods for Plane, Sprite

Constant Summary collapse

BLEND =
{0 => :default, 1 => :additive, 2 => :subtractive}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bitmapObject

Returns the value of attribute bitmap.



10
11
12
# File 'lib/rgss3/container.rb', line 10

def bitmap
  @bitmap
end

#blend_typeObject

Returns the value of attribute blend_type.



11
12
13
# File 'lib/rgss3/container.rb', line 11

def blend_type
  @blend_type
end

#colorObject

Returns the value of attribute color.



11
12
13
# File 'lib/rgss3/container.rb', line 11

def color
  @color
end

#opacityObject

Returns the value of attribute opacity.



12
13
14
# File 'lib/rgss3/container.rb', line 12

def opacity
  @opacity
end

#oxObject

Returns the value of attribute ox.



6
7
8
# File 'lib/rgss3/container.rb', line 6

def ox
  @ox
end

#oyObject

Returns the value of attribute oy.



6
7
8
# File 'lib/rgss3/container.rb', line 6

def oy
  @oy
end

#toneObject

Returns the value of attribute tone.



8
9
10
# File 'lib/rgss3/container.rb', line 8

def tone
  @tone
end

#viewportObject

Returns the value of attribute viewport.



7
8
9
# File 'lib/rgss3/container.rb', line 7

def viewport
  @viewport
end

#visibleObject

Returns the value of attribute visible.



7
8
9
# File 'lib/rgss3/container.rb', line 7

def visible
  @visible
end

#zObject

Returns the value of attribute z.



6
7
8
# File 'lib/rgss3/container.rb', line 6

def z
  @z
end

#zoom_xObject

Returns the value of attribute zoom_x.



9
10
11
# File 'lib/rgss3/container.rb', line 9

def zoom_x
  @zoom_x
end

#zoom_yObject

Returns the value of attribute zoom_y.



9
10
11
# File 'lib/rgss3/container.rb', line 9

def zoom_y
  @zoom_y
end

Instance Method Details

#disposeObject



36
37
38
39
40
# File 'lib/rgss3/container.rb', line 36

def dispose
  @disposed = true
  @bitmap = nil
  Graphics.remove_container(self)
end

#disposed?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/rgss3/container.rb', line 42

def disposed?
  @disposed
end

#do_drawObject

this method is used internally by Graphics



55
56
57
58
# File 'lib/rgss3/container.rb', line 55

def do_draw
  return if !@visible || @opacity == 0 || @bitmap.nil? || @bitmap.disposed?
  draw
end

#drawObject

overwrite



51
52
# File 'lib/rgss3/container.rb', line 51

def draw
end

#initialize(viewport = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rgss3/container.rb', line 16

def initialize(viewport = nil)
  @visible = true
  @z = 0
  @ox = 0
  @oy = 0
  @tone = Tone.new
  @viewport = viewport
  @zoom_x = @zoom_y = 1.0
  @blend_type = 0
  @color = Color.new
  @opacity = 255
  Graphics.add_container(self)
end

#initialize_copyObject



30
31
32
33
34
# File 'lib/rgss3/container.rb', line 30

def initialize_copy
  copy = super
  Graphics.add_container(copy)
  copy
end