Project1
标题:
把圖片加入到RPG::Cache.animation的方法
[打印本页]
作者:
Vernon126
时间:
2008-5-6 07:08
提示:
作者被禁止或删除 内容自动屏蔽
作者:
3535
时间:
2008-5-6 07:16
脚本请插入工程的Main之前:
module RPG
class Sprite < ::Sprite
def dispose_animation
if @_animation_sprites != nil
sprite = @_animation_sprites[0]
if sprite != nil
@@_reference_count[sprite.bitmap] -= 1
end
for sprite in @_animation_sprites
sprite.dispose
end
@_animation_sprites = nil
@_animation = nil
end
end
end
end
复制代码
作者:
Vernon126
时间:
2008-5-6 09:16
提示:
作者被禁止或删除 内容自动屏蔽
作者:
神思
时间:
2008-5-6 18:19
因为RPG::Cache.animation就是生成了一个Bitmap.但未释放
RPG::Cache.animation("file")
100.times{ RPG::Cache.animation("file") }
复制代码
Bitmap.new("Graphics/Animations/file")
100.times{ Bitmap.new("Graphics/Animations/file") }
复制代码
可以测试以上的2个代码..
前者几乎瞬间完成
后者..
作者:
Vernon126
时间:
2008-5-7 00:45
提示:
作者被禁止或删除 内容自动屏蔽
作者:
Vernon126
时间:
2008-5-7 01:03
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1