赞 | 5 |
VIP | 359 |
好人卡 | 195 |
积分 | 3 |
经验 | 560179 |
最后登录 | 2024-11-20 |
在线时间 | 1374 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 280
- 在线时间
- 1374 小时
- 注册时间
- 2005-10-16
- 帖子
- 5113
|
本帖最后由 亿万星辰 于 2011-9-6 18:02 编辑
图片按钮脚本里的两个方法替换掉就好了~- #--------------------------------------------------------------------------
- # ● 描绘图片项目
- # index : 项目编号
- # type : 描绘类型
- # type = 1 只支持键盘
- # type = 2 双面支持
- #--------------------------------------------------------------------------
- def draw_picture_item(index, type)
- @sprite[index] = Sprite.new
- if @commands[index][0] == nil
- p "图片名设置有误"
- end
- if @commands[index][1] == nil
- p "图片X坐标设置有误"
- end
- if @commands[index][2] == nil
- p "图片Y坐标设置有误"
- end
- bitmap = RPG::Cache.picture(@commands[index][0])
- @sprite[index].bitmap = bitmap
- @sprite[index].ox = bitmap.width / 2
- @sprite[index].oy = bitmap.height / 2
- @sprite[index].x = @commands[index][1]
- @sprite[index].y = @commands[index][2]
- @sprite[index].index = index
- 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
- @dash.push(index)
- 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
- 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)
- @sprite[index].zoom_x = 1
- @sprite[index].zoom_y = 1
- else
- @sprite[index].color = Color.new(0,0,0,0)
- @sprite[index].zoom_x = 1.2
- @sprite[index].zoom_y = 1.2
- 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
复制代码 |
|