[Thảo Luận] Cần giúp đỡ về script

Mình đang viết một script! Trong hình, cái cursor nó bị sao ra làm nhiều phần! Các bạn có thể giúp mình làm cho nó thành 1 cái thôi được không?
hiBaqc7.png
Hoặc nói cho mình cấu trúc của def "update_cursor_rect" trong Window_Selectable
Ở dòng 126, mình thay đoạn self.cursor_rect.set(x, y, cursor_width, 32) > draw_picture(x, y, "cursor_menu")
draw_picture là def mình tạo ra để hiển thị cursor với rect w=64, h=64
"cursor_menu" là hình ảnh cursor!
Đây là đoạn code def update_cursor_rect nhé !
Mình sử dụng RPG Maker XP
def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 32 - self.oy
    $game_variables[3] = x
    # Update cursor rectangle
    draw_picture(x, y, "cursor_menu")
    #self.cursor_rect.set(x, y, cursor_width, 32)
  end

Comments

Sign In or Register to comment.