赞 | 3 |
VIP | 32 |
好人卡 | 0 |
积分 | 1 |
经验 | 14756 |
最后登录 | 2021-5-30 |
在线时间 | 579 小时 |
Lv1.梦旅人 小小的百鬼夜行<
- 梦石
- 0
- 星屑
- 54
- 在线时间
- 579 小时
- 注册时间
- 2010-7-29
- 帖子
- 2682
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 退屈£无聊 于 2011-7-31 08:20 编辑
前言:
仅仅是对sprite写了一点小加强,觉得此功能渣者请无视。
然后表示欢迎各位提供建议、灵感、BUG恩。- #===============================================================================
- # ■ [GR]一堆精灵放圆上
- #-------------------------------------------------------------------------------
- # 写了sprite的某种加强
- #-------------------------------------------------------------------------------
- # 更新作者: 退屈无聊
- # 许可协议: FSL
- # 引用网址:
- #-------------------------------------------------------------------------------
- # - 1.0.0719 By 退屈无聊
- # * 初版;
- #===============================================================================
- $fscript = {} if $fscript.nil?
- $fscript['Sprite_Round'] = '1.0.0719'
- class Sprite_Round < Sprite
- attr_accessor(:rid, :rx, :ry, :zoomplus, :x_1, :y_1)
- def initialize(rid, rx, ry, rwidth, rheight, zoomplus=0.0, zoom=true)
- super()
- @rid = rid
- @rx = rx
- @ry = ry
- @rwidth = rwidth
- @rheight = rheight
- @zoomplus = zoomplus
- @zoom = zoom
- @x_1 = 0
- @y_1 = 0
- round_update
- end
- def round_update
- self.x = @rx
- self.y = @ry
- case @rid
- when 0..90
- if @rid == 0
- self.x += @rx
- self.y += @ry + @rheight
- else
- self.x += @rx + (Math.sin(Math::PI / (180.0 / @rid)) * @rwidth).to_i
- self.y += @ry + (Math.cos(Math::PI / (180.0 / @rid)) * @rheight).to_i
- end
- when 91..180
- self.x += @rx + (Math.cos(Math::PI / (180.0 / (@rid-90))) * @rwidth).to_i
- self.y += @ry - (Math.sin(Math::PI / (180.0 / (@rid-90))) * @rheight).to_i
- when 181..270
- self.x += @rx - (Math.sin(Math::PI / (180.0 / (@rid-180))) * @rwidth).to_i
- self.y += @ry - (Math.cos(Math::PI / (180.0 / (@rid-180))) * @rheight).to_i
- when 271..360
- self.x += @rx - (Math.cos(Math::PI / (180.0 / (@rid-270))) * @rwidth).to_i
- self.y += @ry + (Math.sin(Math::PI / (180.0 / (@rid-270))) * @rheight).to_i
- end
- self.x += @x_1
- self.y += @y_1
- self.z = self.y
- self.zoom_x = self.zoom_y = self.y / 480.0 + @zoomplus if @zoom
- end
- def rid=(rid)
- @rid = rid
- if @rid > 360
- @rid -= 360
- elsif @rid < 0
- @rid += 360
- end
- round_update
- end
- def ry=(ry)
- @ry = ry
- round_update
- end
- def rx=(rx)
- @rx = rx
- round_update
- end
- def zoomplus=(a)
- @zoomplus = a
- round_update
- end
- def x_1=(a)
- @x_1 = a
- round_update
- end
- def y_1=(a)
- @y_1 = a
- round_update
- end
- end
复制代码 |
|