Advertisement
Kakakadafi

TheoAllen - Custom Title (Shaz's Mouse Script Support)

May 30th, 2015
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.85 KB | None | 0 0
  1. # =============================================================================
  2. # GAME LU GA BOLEH NEP!
  3. # =============================================================================
  4. class TitleCommandset
  5.   alias new_update_index update_index
  6.   def update_index
  7.     new_update_index
  8.     mx, my = *Mouse.position
  9.     for i in 0...@commands.size
  10.     px = @commands[i].pos_x; py = @commands[i].pos_y
  11.       if mx.between?(px, px + @commands[i].lebar) &&
  12.         my.between?(py, py  + @commands[i].tinggi)
  13.         Sound.play_cursor if @index != i
  14.         @index = i
  15.         @commands.each {|cmd| cmd.unselect}
  16.         @commands[i].select
  17.         break
  18.       end
  19.     end
  20.   end
  21. end
  22.  
  23. class TitleCommand < Sprite
  24.   def pos_x; return self.x; end
  25.   def pos_y; return self.y; end
  26.   def lebar; return self.width; end
  27.   def tinggi; return self.height; end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement