赞 | 0 |
VIP | 5 |
好人卡 | 14 |
积分 | 15 |
经验 | 110639 |
最后登录 | 2015-10-15 |
在线时间 | 1157 小时 |
Lv3.寻梦者 小柯的徒弟
- 梦石
- 0
- 星屑
- 1535
- 在线时间
- 1157 小时
- 注册时间
- 2008-5-24
- 帖子
- 3085
|
- $动画编号 = 1
- module Mouse
- def self.init(sprite = nil)
- $ShowCursor.call(0)
- @show_cursor = false
- @mouse_sprite = RPG::Sprite.new
- @mouse_sprite.z = 99999
- @mouse_sprite.bitmap = Bitmap.new('Graphics/Icons/mouse.png')
- @left_press = false
- @right_press = false
- @left_trigger = false
- @right_trigger = false
- @left_repeat = false
- @right_repeat = false
- @click_lock = false
- update
- end
-
- def self.update
- left_down = $GetKeyState.call(0x01)
- right_down = $GetKeyState.call(0x02)
- if Mouse.trigger?(Mouse::LEFT) and $scene.is_a?(Scene_Map)
- $data_animations = load_data("Data/Animations.rxdata") if $data_animations==nil
- @mouse_sprite.animation($data_animations[$动画编号],true)
- end
- @mouse_sprite.update
- @click_lock = false
- mouse_x, mouse_y = self.get_mouse_pos
- if @mouse_sprite != nil
- @mouse_sprite.x = mouse_x
- @mouse_sprite.y = mouse_y
- end
- if left_down[7] == 1
- @left_repeat = (not @left_repeat)
- @left_trigger = (not @left_press)
- @left_press = true
- else
- @left_press = false
- @left_trigger = false
- @left_repeat = false
- end
- if right_down[7] == 1
- @right_repeat = (not @right_repeat)
- @right_trigger = (not @right_press)
- @right_press = true
- else
- @right_press = false
- @right_trigger = false
- @right_repeat = false
- end
- end
- end
- Mouse.init
- END { Mouse.exit }
复制代码 保留原来的鼠标脚本,这个脚本放它的下面。 |
|