永发信息网

谁能告诉我RPG Maker XP的鼠标脚本啊?

答案:2  悬赏:10  手机版
解决时间 2021-02-06 14:22
会的人教我
最佳答案
mouse_x, mouse_y = Mouse.get_mouse_pos
mouse_not_in_rect = true
for i in (0...CHARACTER_TABLE.size).to_a.push(180)
@index = i
update_cursor_rect
top_x = self.cursor_rect.x + self.x + 16
top_y = self.cursor_rect.y + self.y + 16
bottom_x = top_x + self.cursor_rect.width
bottom_y = top_y + self.cursor_rect.height
#
if (mouse_x > top_x) and (mouse_y > top_y) and
(mouse_x < bottom_x) and (mouse_y < bottom_y)
mouse_not_in_rect = false
break
end
end
if mouse_not_in_rect
@index = index_var
update_cursor_rect
Mouse.click_lock
else
Mouse.click_unlock
end
end
end
end
class Window_InputNumber
if @self_alias == nil
alias self_update update
@self_alias = true
end
def update
#self.cursor_rect.empty
self_update
mouse_x, mouse_y = Mouse.get_mouse_pos
if self.active and @digits_max > 0
index_var = @index
mouse_not_in_rect = true
for i in 0...@digits_max
@index = i
update_cursor_rect
top_x = self.cursor_rect.x + self.x + 16
bottom_x = top_x + self.cursor_rect.width
#
if (mouse_x > top_x) and (mouse_x < bottom_x)
mouse_not_in_rect = false
break
end
end
if mouse_not_in_rect
@index = index_var
update_cursor_rect
Mouse.click_lock
else
Mouse.click_unlock
end
end
if @last_mouse_y == nil
@last_mouse_y = mouse_y
end
check_pos = (@last_mouse_y - mouse_y).abs
if check_pos > 10
$game_system.se_play($data_system.cursor_se)
place = 10 ** (@digits_max - 1 - @index)
n = @number / place % 10
@number -= n * place
n = (n + 1) % 10 if mouse_y < @last_mouse_y
n = (n + 9) % 10 if mouse_y > @last_mouse_y
@number += n * place
refresh
@last_mouse_y = mouse_y
end
end
end
class Scene_File
if @self_alias == nil
alias self_update update
@self_alias = true
end
def update
mouse_x, mouse_y = Mouse.get_mouse_pos
Mouse.click_lock
idx = 0
for i in @savefile_windows
top_x = i.x + 16
top_y = i.y + 16
bottom_x = top_x + i.width
bottom_y = top_y + i.height
if (mouse_x > top_x) and (mouse_y > top_y) and
(mouse_x < bottom_x) and (mouse_y < bottom_y)
i.selected = true
if @file_index != idx
@file_index = idx
$game_system.se_play($data_system.cursor_se)
end
Mouse.click_unlock
else
i.selected = false
end
idx += 1
end
self_update
end
end
class Arrow_Enemy
if @self_alias == nil
alias self_update update
@self_alias = true
end
def update
mouse_x, mouse_y = Mouse.get_mouse_pos
idx = 0
for i in $game_troop.enemies do
if i.exist?
top_x = i.screen_x - self.ox
top_y = i.screen_y - self.oy
bottom_x = top_x + self.src_rect.width
bottom_y = top_y + self.src_rect.height
if (mouse_x > top_x - $敌人选框扩大) and (mouse_y > top_y - $敌人选框扩大) and
(mouse_x < bottom_x + $敌人选框扩大) and (mouse_y < bottom_y + $敌人选框扩大)
if @index != idx
$game_system.se_play($data_system.cursor_se)
@index = idx
end
end
end
idx += 1
end
self_update
end
end
class Arrow_Actor
if @self_alias == nil
alias self_update update
@self_alias = true
end
def update
mouse_x, mouse_y = Mouse.get_mouse_pos
idx = 0
for i in $game_party.actors do
if i.exist?
top_x = i.screen_x - self.ox
top_y = i.screen_y - self.oy
bottom_x = top_x + self.src_rect.width
bottom_y = top_y + self.src_rect.height
if (mouse_x > top_x - $角色选框扩大) and (mouse_y > top_y - $角色选框扩大) and
(mouse_x < bottom_x + $角色选框扩大) and (mouse_y < bottom_y + $角色选框扩大)
if @index != idx
$game_system.se_play($data_system.cursor_se)
@index = idx
end
end
end
idx += 1
end
self_update
end
end
class Game_Player
if @self_alias == nil
alias self_update update
@self_alias = true
end
def update
mouse_x, mouse_y = Mouse.get_mouse_pos
if Mouse.trigger?(Mouse::LEFT)
unless $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
@mouse_sta = 1
trg_x = (mouse_x + $game_map.display_x / 4) / 32
trg_y = (mouse_y + $game_map.display_y / 4) / 32
@paths_id = 0
end
end
if @mouse_sta != nil and @mouse_sta == 1
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if @paths_id != nil and @paths != nil and @paths_id <= @paths.size
case @paths[@paths_id]
when 6
@last_move_x = true
move_right
@paths_id += 1
@direction = 6
when 4
@last_move_x = true
move_left
@paths_id += 1
@direction = 4
when 2
@last_move_x = false
move_down
@direction = 2
@paths_id += 1
when 8
@last_move_x = false
move_up
@direction = 8
@paths_id += 1

when 1
@last_move_x = false
move_lower_left
@direction = 1
@paths_id += 1
when 3
@last_move_x = false
move_lower_right
@direction = 3
@paths_id += 1
when 7
@last_move_x = false
move_upper_left
@direction = 7
@paths_id += 1
when 9
@last_move_x = false
move_upper_right
@direction = 9
@paths_id += 1
end
else
@mouse_sta = 0
end
end
end
self_update
end
end
Mouse.init
END { Mouse.exit }一次粘不了,分两次。这个脚本有点盗版(一开始冲突,我改了一下),如果你是脚本错误就下个容错脚本。还有,对话时点右键会错误,点左键没事。其他的错误我还不晓得。你可以都试试。还有啊,左键确定,右键呼出菜单/返回到上一层
全部回答
这个说起来比较麻烦 建议你去 66rpg 去看看,我就是从那里学的,有很多的教程和素材 还可以直接下网友的自制游戏,用rpg maker xp 打开,看看别人是怎么做的 再加上自己的研究创新就可以做出自己的游戏了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
扬州友谊幼儿园地址在哪,我要去那里办事
puzzle的动词原型和单三是什么?
平谷区那可以作无痛人流!具体多少钱(要最安
扬州市维扬区久扬艺术幼儿园地址在什么地方,
穿越火线CFLog
交城县人民医院-外科这个地址在什么地方,我
月亮的背后不是光 是什么?周杰伦成功的背后是
SQL,MySQL都分别有哪些认证
1碳酸根离子中含有多少电子 如何计算
中国野生大熊猫还有多少
如何用红黑蓝三种颜色的笔订正题目?
金融专业好不好
在离体的植物器官、组织或细胞脱分化形成愈伤
体育彩票中4个号是什么奖
小学生道德日记30字
推荐资讯
产生通货紧缩的原因包括()。A.货币供给偏紧或
黑珍珠煮了之后怎么防止变硬
馒乡人在什么地方啊,我要过去处理事情
射手座男与射手座女
生活于树木茂密的森林中的鸟类,最可能通过哪
招商银行可以交易美元指数期货吗
毛坪河小学地址有知道的么?有点事想过去
深港酒店公寓海雅缤纷城店地址有知道的么?有
诚信宾馆(许昌长葛市)地址有知道的么?有点事
圣传讲的什么故事???
洁美秀洗浴我想知道这个在什么地方
时代汽车邯郸华伟地址好找么,我有些事要过去
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?