#==============================================================================
# ■ Sprite_Picture
#------------------------------------------------------------------------------
# 픽쳐 표시용의 스프라이트입니다. Game_Picture 클래스의 인스턴스를 감시해,
# 스프라이트 상태를 자동적으로 변화시킵니다.
#==============================================================================
class Sprite_Picture < Sprite
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
# viewport : 뷰포트
# picture : 픽쳐 (Game_Picture)
#--------------------------------------------------------------------------
def initialize(viewport, picture)
super(viewport)
@picture = picture
update
end
#--------------------------------------------------------------------------
# ● 해방
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 프레임 갱신
#--------------------------------------------------------------------------
def update
super
if @picture_name != @picture.name
@picture_name = @picture.name
if @picture_name != ""
self.bitmap = Cache.picture(@picture_name)
end
end
if @picture_name == ""
self.visible = false
else
self.visible = true
if @picture.origin == 0
self.ox = 0
self.oy = 0
else
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
end
self.x = @picture.x
self.y = @picture.y
self.z = 100 + @picture.number
self.zoom_x = @picture.zoom_x / 100.0
self.zoom_y = @picture.zoom_y / 100.0
self.opacity = @picture.opacity
self.blend_type = @picture.blend_type
self.angle = @picture.angle
self.tone = @picture.tone
end
end
end