#默认旋转只支持左上角和中心两种旋转模式。想要自由旋转的话很不方便呢。
#本脚本的功能是可以把图片的原点放在任何位置。自由定义旋转中心。
#事件中选择脚本选项:输入screen.pictures[图片编号].free_show即可,参数很多请勿漏
#函数参数填写顺序:(文件名,原点类型(填写2),x坐标,y坐标,中心x坐标,中心y坐标,
#x方向缩放率,y方向缩放率,不透明度(单位为100),合成方式(0为普通1为加法2为减法))
#作者:梅林
#可以随意使用修改不用保留作者名字。其实这个用起来不很方便,抛砖引玉。
class Game_Picture
attr_reader :free_ox
attr_reader :free_oy
alias merlin20171109_init_basic init_basic
def init_basic
merlin20171109_init_basic
@free_ox = @free_oy = 0
end
def free_show(name, origin, x, y, free_ox, free_oy, 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
@free_ox = free_ox.to_f
@free_oy = free_oy.to_f
init_target
init_tone
init_rotate
end
end
class Sprite_Picture < Sprite
alias merlin20171109_update_origin update_origin
def update_origin
if @picture.origin == 0
self.ox = 0
self.oy = 0
else
if @picture.origin == 1
self.ox = bitmap.width / 2
self.oy = bitmap.height / 2
else
self.ox = @picture.free_ox
self.oy = @picture.free_oy
end
end
end
end
#默认旋转只支持左上角和中心两种旋转模式。想要自由旋转的话很不方便呢。
#本脚本的功能是可以把图片的原点放在任何位置。自由定义旋转中心。
#事件中选择脚本选项:输入screen.pictures[图片编号].free_show即可,参数很多请勿漏
#函数参数填写顺序:(文件名,原点类型(填写2),x坐标,y坐标,中心x坐标,中心y坐标,
#x方向缩放率,y方向缩放率,不透明度(单位为100),合成方式(0为普通1为加法2为减法))
#作者:梅林
#可以随意使用修改不用保留作者名字。其实这个用起来不很方便,抛砖引玉。
class Game_Picture
attr_reader :free_ox
attr_reader :free_oy
alias merlin20171109_init_basic init_basic
def init_basic
merlin20171109_init_basic
@free_ox = @free_oy = 0
end
def free_show(name, origin, x, y, free_ox, free_oy, 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
@free_ox = free_ox.to_f
@free_oy = free_oy.to_f
init_target
init_tone
init_rotate
end
end
class Sprite_Picture < Sprite
alias merlin20171109_update_origin update_origin
def update_origin
if @picture.origin == 0
self.ox = 0
self.oy = 0
else
if @picture.origin == 1
self.ox = bitmap.width / 2
self.oy = bitmap.height / 2
else
self.ox = @picture.free_ox
self.oy = @picture.free_oy
end
end
end
end