赞 | 0 |
VIP | 3 |
好人卡 | 0 |
积分 | 1 |
经验 | 14326 |
最后登录 | 2021-12-28 |
在线时间 | 65 小时 |
Lv1.梦旅人 清纯红
- 梦石
- 0
- 星屑
- 61
- 在线时间
- 65 小时
- 注册时间
- 2009-7-23
- 帖子
- 995
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 后知后觉 于 2009-12-6 13:37 编辑
范例:
华丽的图片过渡效果.rar
(192.43 KB, 下载次数: 933)
脚本:- #华丽的图片过渡 1.0
- #by 赤点
- #使用方法看事件里的设置
- #现在只支持640@480的图片
- class Sprc
- def self.change1(bitmap)
- v1 = Viewport.new(-320, 0,320,480)
- v2 = Viewport.new(640, 0,320,480)
- @tem1 = Sprite.new(v1)
- @tem2 = Sprite.new(v2)
- @tem1.bitmap = bitmap
- @tem2.bitmap = bitmap
- @tem2.x = -320
- loop do
- Graphics.update
- @tem1.viewport.rect.x += 8#速度可以自己挑,值越大越快
- @tem2.viewport.rect.x -= 8
- if @tem1.viewport.rect.x >= 0
- break
- end
- end
- end
-
- def self.dispose1(bitmap)
- v1 = Viewport.new(0, 0,320,480)
- v2 = Viewport.new(320, 0,320,480)
- tem1 = Sprite.new(v1)
- tem2 = Sprite.new(v2)
- tem1.bitmap = bitmap
- tem2.bitmap = bitmap
- tem2.x = -320
- @tem1.dispose
- @tem2.dispose
- loop do
- Graphics.update
- tem1.viewport.rect.x -= 8#速度可以自己挑,值越大越快
- tem2.viewport.rect.x += 8
- if tem2.viewport.rect.x >= 640
- tem1.bitmap.dispose
- tem2.bitmap.dispose
- break
- end
- end
- end
- def self.change2(bitmap)
- v1 = Viewport.new(0, -480,320,480)
- v2 = Viewport.new(320, 480,320,480)
- @tem1 = Sprite.new(v1)
- @tem2 = Sprite.new(v2)
- @tem1.bitmap = bitmap
- @tem2.bitmap = bitmap
- @tem2.x = -320
- loop do
- Graphics.update
- @tem1.viewport.rect.y += 8#速度可以自己挑,值越大越快
- @tem2.viewport.rect.y -= 8
- if @tem1.viewport.rect.y >= 0
- break
- end
- end
- end
- def self.dispose2(bitmap)
- v1 = Viewport.new(0, 0,320,480)
- v2 = Viewport.new(320, 0,320,480)
- tem1 = Sprite.new(v1)
- tem2 = Sprite.new(v2)
- tem1.bitmap = bitmap
- tem2.bitmap = bitmap
- tem2.x = -320
- @tem1.dispose
- @tem2.dispose
- loop do
- Graphics.update
- tem1.viewport.rect.y -= 8#速度可以自己挑,值越大越快
- tem2.viewport.rect.y += 8
- if tem2.viewport.rect.y >= 480
- tem1.bitmap.dispose
- tem2.bitmap.dispose
- break
- end
- end
- end
- def self.change3(bitmap)
- v1 = Viewport.new(0, -240,640,240)
- v2 = Viewport.new(0, 480,640,240)
- @tem1 = Sprite.new(v1)
- @tem2 = Sprite.new(v2)
- @tem1.bitmap = bitmap
- @tem2.bitmap = bitmap
- @tem2.y = -240
- loop do
- Graphics.update
- @tem1.viewport.rect.y += 8
- @tem2.viewport.rect.y -= 8#速度可以自己挑,值越大越快
- if @tem1.viewport.rect.y >= 0
- break
- end
- end
- end
- def self.dispose3(bitmap)
- v1 = Viewport.new(0, 0,640,240)
- v2 = Viewport.new(0, 240,640,240)
- tem1 = Sprite.new(v1)
- tem2 = Sprite.new(v2)
- tem1.bitmap = bitmap
- tem2.bitmap = bitmap
- tem2.y = -240
- @tem1.dispose
- @tem2.dispose
- loop do
- Graphics.update
- tem1.viewport.rect.y -= 8#速度可以自己挑,值越大越快
- tem2.viewport.rect.y += 8
- if tem2.viewport.rect.y >= 480
- break
- end
- end
- end
- def self.change4(bitmap)
- v1 = Viewport.new(-640, 0,640,240)
- v2 = Viewport.new(640, 240,640,240)
- @tem1 = Sprite.new(v1)
- @tem2 = Sprite.new(v2)
- @tem1.bitmap = bitmap
- @tem2.bitmap = bitmap
- @tem2.y = -240
- loop do
- Graphics.update
- @tem1.viewport.rect.x += 8#速度可以自己挑,值越大越快
- @tem2.viewport.rect.x -= 8
- if @tem1.viewport.rect.x >= 0
- break
- end
- end
- end
- def self.dispose4(bitmap)
- v1 = Viewport.new(0, 0,640,240)
- v2 = Viewport.new(0, 240,640,240)
- tem1 = Sprite.new(v1)
- tem2 = Sprite.new(v2)
- tem1.bitmap = bitmap
- tem2.bitmap = bitmap
- tem2.y = -240
- @tem1.dispose
- @tem2.dispose
- loop do
- Graphics.update
- tem1.viewport.rect.x -= 8#速度可以自己挑,值越大越快
- tem2.viewport.rect.x += 8
- if tem2.viewport.rect.x >= 640
- break
- end
- end
- end
- end
复制代码 |
|