赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 8720 |
最后登录 | 2013-7-16 |
在线时间 | 433 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 433 小时
- 注册时间
- 2010-5-13
- 帖子
- 116
|
本帖最后由 005020671 于 2012-9-26 12:16 编辑
refresh方法可以这么写、减少计算量、- @text_temp #存储信息临时变量
- text = $game_temp.tipping
-
- if @text_temp != text #如果提示信息和上次信息不相等才重新计算
- @text_temp = text
- self.x = (580-(text.to_s.size / 3 * 32))/2
- self.width = (text.to_s.size / 3 * 32)+32
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.draw_text(0, -2, (text.to_s.size / 3 * 32), 32, text,1)
- end
复制代码 |
|