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 算的, 所以如果那个脚本随便一改 这个就不能用了  = =

  1. class Window_标题 < Window_Selectable
  2.   alias mouseUpdate update
  3.   def update
  4.     mouse_posX, mouse_posY = Mouse.get_mouse_pos
  5.     mouseHold = false
  6.     @commands.size.times{
  7.       |i|
  8.       x = self.x + (i % @column_max * 20 + 100 + 160)
  9.       y = self.y + (i / @column_max * 20 + 100 - 50)
  10.       if (IsMousePosInRect(mouse_posX, mouse_posY, x, y, 128, 32))
  11.         mouseHold = true
  12.         @index = i
  13.         break
  14.       end
  15.     }
  16.     if (!mouseHold)
  17.       mouseUpdate
  18.     else
  19.       update_cursor_rect
  20.     end   
  21.   end
  22.   def IsMousePosInRect(mouseX, mouseY, rX, rY, rW, rH)
  23.      return ((mouseX>=rX)&&(mouseX<=rX+rW))&&((mouseY>=y)&&(mouseY<=rY+rH));
  24.   end
  25. end
复制代码

[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1