Class: Sprite_Picture
- Inherits:
-
Sprite
- Object
- Sprite
- Sprite_Picture
- Defined in:
- lib/rgss3_default_scripts/Sprite_Picture.rb
Overview
** Sprite_Picture
This sprite is used to display pictures. It observes an instance of the
Game_Picture class and automatically changes sprite states.
Instance Method Summary collapse
-
#dispose ⇒ Object
————————————————————————– * Free ————————————————————————–.
-
#initialize(viewport, picture) ⇒ Sprite_Picture
constructor
————————————————————————– * Object Initialization picture : Game_Picture ————————————————————————–.
-
#update ⇒ Object
————————————————————————– * Frame Update ————————————————————————–.
-
#update_bitmap ⇒ Object
————————————————————————– * Update Transfer Origin Bitmap ————————————————————————–.
-
#update_origin ⇒ Object
————————————————————————– * Update Origin ————————————————————————–.
-
#update_other ⇒ Object
————————————————————————– * Update Other ————————————————————————–.
-
#update_position ⇒ Object
————————————————————————– * Update Position ————————————————————————–.
-
#update_zoom ⇒ Object
————————————————————————– * Update Zoom Factor ————————————————————————–.
Constructor Details
#initialize(viewport, picture) ⇒ Sprite_Picture
-
Object Initialization
picture : Game_Picture
13 14 15 16 17 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 13 def initialize(, picture) super() @picture = picture update end |
Instance Method Details
#dispose ⇒ Object
-
Free
21 22 23 24 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 21 def dispose bitmap.dispose if bitmap super end |
#update ⇒ Object
-
Frame Update
28 29 30 31 32 33 34 35 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 28 def update super update_bitmap update_origin update_position update_zoom update_other end |
#update_bitmap ⇒ Object
-
Update Transfer Origin Bitmap
39 40 41 42 43 44 45 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 39 def update_bitmap if @picture.name.empty? self.bitmap = nil else self.bitmap = Cache.picture(@picture.name) end end |
#update_origin ⇒ Object
-
Update Origin
49 50 51 52 53 54 55 56 57 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 49 def update_origin if @picture.origin == 0 self.ox = 0 self.oy = 0 else self.ox = bitmap.width / 2 self.oy = bitmap.height / 2 end end |
#update_other ⇒ Object
-
Update Other
76 77 78 79 80 81 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 76 def update_other self.opacity = @picture.opacity self.blend_type = @picture.blend_type self.angle = @picture.angle self.tone.set(@picture.tone) end |
#update_position ⇒ Object
-
Update Position
61 62 63 64 65 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 61 def update_position self.x = @picture.x self.y = @picture.y self.z = @picture.number end |
#update_zoom ⇒ Object
-
Update Zoom Factor
69 70 71 72 |
# File 'lib/rgss3_default_scripts/Sprite_Picture.rb', line 69 def update_zoom self.zoom_x = @picture.zoom_x / 100.0 self.zoom_y = @picture.zoom_y / 100.0 end |