Class: Game_Picture
- Defined in:
- scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb
Overview
Describe a picture display on the Screen
Instance Attribute Summary collapse
-
#angle
readonly
回転角度.
-
#blend_type
readonly
ブレンド方法.
-
#mirror
Returns the value of attribute mirror.
-
#name
readonly
ファイル名.
-
#number
readonly
ピクチャ番号.
-
#opacity
readonly
不透明度.
-
#origin
readonly
原点.
-
#tone
readonly
色調.
-
#x
readonly
X 座標.
-
#y
readonly
Y 座標.
-
#zoom_x
readonly
X 方向拡大率.
-
#zoom_y
readonly
Y 方向拡大率.
Instance Method Summary collapse
-
#erase
Remove the picture from the screen.
-
#initialize(number) ⇒ Game_Picture
constructor
Initialize the Game_Picture with default value.
-
#move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
Move a picture.
-
#rotate(speed)
Rotate the picture.
-
#show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
Show a picture.
-
#start_tone_change(tone, duration)
Start a tone change of the picture.
-
#update
Update the picture state change.
Constructor Details
#initialize(number) ⇒ Game_Picture
Initialize the Game_Picture with default value
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 19 def initialize(number) @number = number @name = nil.to_s @origin = 0 @x = 0.0 @y = 0.0 @zoom_x = 100.0 @zoom_y = 100.0 @opacity = 255.0 @blend_type = 1 @duration = 0 @target_x = @x @target_y = @y @target_zoom_x = @zoom_x @target_zoom_y = @zoom_y @target_opacity = @opacity @tone = Tone.new(0, 0, 0, 0) @tone_target = Tone.new(0, 0, 0, 0) @tone_duration = 0 @angle = 0 @rotate_speed = 0 @mirror = false end |
Instance Attribute Details
#angle (readonly)
回転角度
15 16 17 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 15 def angle @angle end |
#blend_type (readonly)
ブレンド方法
13 14 15 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 13 def blend_type @blend_type end |
#mirror
Returns the value of attribute mirror.
16 17 18 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 16 def mirror @mirror end |
#name (readonly)
ファイル名
6 7 8 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 6 def name @name end |
#number (readonly)
ピクチャ番号
5 6 7 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 5 def number @number end |
#opacity (readonly)
不透明度
12 13 14 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 12 def opacity @opacity end |
#origin (readonly)
原点
7 8 9 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 7 def origin @origin end |
#tone (readonly)
色調
14 15 16 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 14 def tone @tone end |
#x (readonly)
X 座標
8 9 10 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 8 def x @x end |
#y (readonly)
Y 座標
9 10 11 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 9 def y @y end |
#zoom_x (readonly)
X 方向拡大率
10 11 12 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 10 def zoom_x @zoom_x end |
#zoom_y (readonly)
Y 方向拡大率
11 12 13 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 11 def zoom_y @zoom_y end |
Instance Method Details
#erase
Remove the picture from the screen
107 108 109 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 107 def erase @name = nil.to_s end |
#move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
Move a picture
81 82 83 84 85 86 87 88 89 90 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 81 def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type) @duration = duration @origin = origin @target_x = x.to_f @target_y = y.to_f @target_zoom_x = zoom_x.to_f @target_zoom_y = zoom_y.to_f @target_opacity = opacity.to_f @blend_type = blend_type end |
#rotate(speed)
Rotate the picture
93 94 95 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 93 def rotate(speed) @rotate_speed = speed end |
#show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
Show a picture
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 51 def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type) @name = name @origin = origin @x = x.to_f @y = y.to_f @zoom_x = zoom_x.to_f @zoom_y = zoom_y.to_f @opacity = opacity.to_f @blend_type = blend_type @duration = 0 @target_x = @x @target_y = @y @target_zoom_x = @zoom_x @target_zoom_y = @zoom_y @target_opacity = @opacity @tone = Tone.new(0, 0, 0, 0) @tone_target = Tone.new(0, 0, 0, 0) @tone_duration = 0 @angle = 0 @rotate_speed = 0 end |
#start_tone_change(tone, duration)
Start a tone change of the picture
99 100 101 102 103 104 105 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 99 def start_tone_change(tone, duration) @tone_target = tone.clone @tone_duration = duration if @tone_duration == 0 @tone = @tone_target.clone end end |
#update
Update the picture state change
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/01800 Game_Picture.rb', line 116 def update if @duration >= 1 d = @duration @x = (@x * (d - 1) + @target_x) / d @y = (@y * (d - 1) + @target_y) / d @zoom_x = (@zoom_x * (d - 1) + @target_zoom_x) / d @zoom_y = (@zoom_y * (d - 1) + @target_zoom_y) / d @opacity = (@opacity * (d - 1) + @target_opacity) / d @duration -= 1 end if @tone_duration >= 1 d = @tone_duration @tone.red = (@tone.red * (d - 1) + @tone_target.red) / d @tone.green = (@tone.green * (d - 1) + @tone_target.green) / d @tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d @tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d @tone_duration -= 1 end if @rotate_speed != 0 @angle += @rotate_speed / 2.0 while @angle < 0 @angle += 360 end @angle %= 360 end end |