Save-Point
Mousie: The Mouse System - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: Mousie: The Mouse System (/thread-2565.html)

Pages: 1 2 3 4 5 6 7


RE: Mousie: The Mouse System - MechanicalPen - 02-04-2014

This works for me?
Code:
$game_variables[1] =
Mouse.pos_x
$game_variables[2] =
Mouse.pos_y



RE: Mousie: The Mouse System - JayRay - 02-05-2014

interesting, you did that in a script call from an event?


RE: Mousie: The Mouse System - MechanicalPen - 02-05-2014

Sure did. Even used Mouse.click?(Left_Click) in an event's script branch condition.


RE: Mousie: The Mouse System - JayRay - 02-14-2014

Mechanical Pen: How? This is what I created as far as an event, and I get a syntax error..


[Image: question.png]


RE: Mousie: The Mouse System - MechanicalPen - 02-14-2014

It's ' Mouse.click?(Mouse::Left_Click) ' not ' Mouse.click?(Left_Click) '


RE: Mousie: The Mouse System - JayRay - 02-16-2014

got them both working, GUI is awesome!!! (just sayin)


RE: Mousie: The Mouse System - DerVVulfman - 07-19-2015

Riddle me this.   When is a BUMP not a BUMP?

When I'm BUMPING a supplemental system/script.

Has it really been 3 years since my last update?  Well, you have to thank yamina-chan for this one.  She noticed that the Windows Edits which were initially crafted by Lambchop/Amaranth/Amanda Fitch ... didn't properly align the mouse with the characters drawn in the Name Edit window.

Provided below is the new mouse operation method from within the 'Window_NameInput' class.  This method is also available within the complete 'Window Edits' in the main post, but not within the demo itself.  When downloading the demo, you must still update the window edits within.
Code:
  #--------------------------------------------------------------------------

  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    index = @index
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    width   = 28
    height  = 32
    # Exit if between Capital and non-caps
    if ( Mouse.pos_x > 296 && Mouse.pos_x < 350)
      return
    end
    # Switch mx area if going from caps to/from non-caps
    if Mouse.pos_x <= 318
      mx -= 136
    elsif Mouse.pos_x >= 337
      mx -= 166
    end
    for index in 0...180
      x = 4 + index / 5 / 9 * 152 + index % 5 * 32
      y = index / 5 % 9 * 32
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        $game_system.se_play($data_system.cursor_se) unless @index == index
        @index = index
        break
      end
    end
    # Set Y condition for outside boundary check
    # Value of 9 could be 8 ( 8 * 32)  as Last row in CHARACTER_TABLE empty.
    y = 9 * 32
    # Outside test
    outside = false
    outside = true if mx < 4
    outside = true if mx > 312
    outside = true if my < 4
    outside = true if my > y
    # Go to 'OK' if outside character window
    if outside
      $game_system.se_play($data_system.cursor_se) unless @index == 180
      @index = 180
    end
  end

Um, if anyone wants to make the right mouse click delete letters in the name window (rather than the ESC) button, please consider this snippet from Scene_Name:
Code:
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @edit_window.update
    @input_window.update
    # If B button was pressed
    if Input.repeat?(Input::B)
      # If cursor position is at 0
      if @edit_window.index == 0
        return
      end
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Delete text
      @edit_window.back
      return
    end
[/code
]The line that reads
[code]if Input.repeat?(Input::B)
may just as easily read as:
Code:
if Input.repeat?(Input::B) or Mouse.click?(Mouse::Right_Click)

Enjoy.


RE: Mousie: The Mouse System - yamina-chan - 07-19-2015

=D
Thank you for finding out what was wrong and for correcting said issue. Very cheery


"And insofar as menu edits, please give credit to yamina-chan who noticed that the default windows edits had not considered proper spacing and handling where the Name Edit Window was concerned." <- *from the first post*
There's really no need for anyone to credit me for that...