Project1
标题:
图片光标中,光标不随鼠标动
[打印本页]
作者:
七仙女
时间:
2008-6-27 02:36
提示:
作者被禁止或删除 内容自动屏蔽
作者:
link006007
时间:
2008-6-27 03:57
鼠标脚本的光标是默认的self.cursor_rect
而这个脚本的光标是Sprite
当然不会移动...
作者:
link006007
时间:
2008-6-28 05:10
那个command window 写太汗了 没看懂它为什么那么算
这个就是直接抄那个drawitem 算的, 所以如果那个脚本随便一改 这个就不能用了 = =
class Window_标题 < Window_Selectable
alias mouseUpdate update
def update
mouse_posX, mouse_posY = Mouse.get_mouse_pos
mouseHold = false
@commands.size.times{
|i|
x = self.x + (i % @column_max * 20 + 100 + 160)
y = self.y + (i / @column_max * 20 + 100 - 50)
if (IsMousePosInRect(mouse_posX, mouse_posY, x, y, 128, 32))
mouseHold = true
@index = i
break
end
}
if (!mouseHold)
mouseUpdate
else
update_cursor_rect
end
end
def IsMousePosInRect(mouseX, mouseY, rX, rY, rW, rH)
return ((mouseX>=rX)&&(mouseX<=rX+rW))&&((mouseY>=y)&&(mouseY<=rY+rH));
end
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1