赞 | 0 |
VIP | 4 |
好人卡 | 43 |
积分 | 94 |
经验 | 75226 |
最后登录 | 2019-3-3 |
在线时间 | 1131 小时 |
Lv4.逐梦者
- 梦石
- 3
- 星屑
- 6420
- 在线时间
- 1131 小时
- 注册时间
- 2007-12-26
- 帖子
- 2402
|
本帖最后由 幻耶 于 2011-11-4 22:48 编辑
茄子的图片按钮,原来的战斗按钮是高亮显示的,我修改成了循环放大缩小显示的效果,但是标题画面的图片按钮也变成了循环放大缩小显示,如何让标题画面的按钮还是原来的高亮显示,战斗按钮继续保持放大缩小显示?
工程:
★_茄孓_图片按钮1.rar
(319.39 KB, 下载次数: 90)
原始脚本高亮显示- #--------------------------------------------------------------------------
- # ● 刷新图片项目
- #--------------------------------------------------------------------------
- def update_item
- if Mouse.get_mouse_pos != nil
- $mouse_x,$mouse_y = Mouse.get_mouse_pos
- end
- if @type == 2
- for index in @dash
- if @sprite[index] != nil
- top_x = @sprite[index].x
- top_y = @sprite[index].y
- bottom_x = top_x + @sprite[index].bitmap.width
- bottom_y = top_y + @sprite[index].bitmap.height
- if ($mouse_x > top_x) and ($mouse_y > top_y) and
- ($mouse_x < bottom_x) and ($mouse_y < bottom_y)
- self.index = @sprite[index].index
- if @move_index != self.index
- Se.ok
- @move_index = self.index
- end
- end
- if @sprite[index].index != self.index
- @sprite[index].color = Color.new(0,0,0,100)
- else
- @sprite[index].color = Color.new(0,0,0,0)
- end
- end
- end
- elsif @type == 1
- for index in @dash
- if @sprite[index].index != self.index
- @sprite[index].color = Color.new(0,0,0,100)
- else
- @sprite[index].color = Color.new(0,0,0,0)
- end
- end
- end
- end
复制代码 修改之后的脚本- #--------------------------------------------------------------------------
- # ● 刷新图片项目
- #--------------------------------------------------------------------------
- def update_item
- if Mouse.get_mouse_pos != nil
- $mouse_x,$mouse_y = Mouse.get_mouse_pos
- end
- if @type == 2
- for index in @dash
- if @sprite[index] != nil
- @count += 1 # XXOO
- top_x = @sprite[index].x - @sprite[index].bitmap.width / 2
- top_y = @sprite[index].y - @sprite[index].bitmap.height / 2
- bottom_x = top_x + @sprite[index].bitmap.width
- bottom_y = top_y + @sprite[index].bitmap.height
- if ($mouse_x > top_x) and ($mouse_y > top_y) and
- ($mouse_x < bottom_x) and ($mouse_y < bottom_y)
- self.index = @sprite[index].index
- if @move_index != self.index
- Se.ok
- @move_index = self.index
- end
- end
- if @sprite[index].index != self.index
- @sprite[index].color = Color.new(0,0,0,100)
- @sprite[index].zoom_x = 1
- @sprite[index].zoom_y = 1
- else
- case @count
- when 1..50
- @sprite[index].zoom_x = 1.0 + @count / 90.0
- @sprite[index].zoom_y = 1.0 + @count / 90.0
- @sprite[index].color = Color.new(0,0,0,0)
- when 51..100
- @sprite[index].zoom_x = 2.0 - (@count - 10) / 90.0
- @sprite[index].zoom_y = 2.0 - (@count - 10) / 90.0
- @sprite[index].color = Color.new(0,0,0,100)
- end
- end
- @count = 0 if @count == 120 # XXOO
- end
- end
- elsif @type == 1
- for index in @dash
- if @sprite[index].index != self.index
- @sprite[index].color = Color.new(0,0,0,100)
- else
- @sprite[index].color = Color.new(0,0,0,0)
- end
- end
- end
- end
复制代码 |
|