A mouseevent is produced whenever the mouse is moved, dragged, clicked or
hits an object. A MouseEvent cannot be modified once it was created.
- new (int x,y,wheel,previousx,previousy,previouswheel,button,eventtype,any src)
- returns: (MouseEvent)
creates a new mouseevent object
- MOUSE_CLICKED
- [int] - eventtype if a mousebutton was pressed and released without moving
- MOUSE_DRAGGED
- [int] - eventtype if the mouse was moved while holding a button
- MOUSE_ENTER
- [int] - eventtype if the mouse entered the source
- MOUSE_EXIT
- [int] - eventtype if the mouse exited the source
- MOUSE_MOVED
- [int] - eventtype if the mouse was moved
- MOUSE_PRESSED
- [int] - eventtype if a mousebutton is pressed down
- MOUSE_RELEASED
- [int] - eventtype if the mouse was released
- MOUSE_WHEEL
- [int] - eventtype if the mouse wheel was moved
- button
- {[int]} - button that produced the mouseevent
- downsince
- {[int]} - since which frame the mouse button was hold down
- eventtype
- {[int]} - eventtype of the occured mouseevent
- getDiff (MouseEvent)
- returns: (int x,y)
returns difference between the two frames
- isClicked (MouseEvent)
- returns: (boolean)
true if the mouse was clicked
- isDragged (MouseEvent)
- returns: (boolean)
true if the mouse was dragged
- isMoved (MouseEvent)
- returns: (boolean)
true if the mouse was moved
- isPressed (MouseEvent)
- returns: (boolean)
true if the mouse was pressed
- isReleased (MouseEvent)
- returns: (boolean)
true if the mouse was released
- isWheeled (MouseEvent)
- returns: (boolean)
true if the wheel was moved
- move (MouseEvent self, int x,y)
- returns: (MouseEvent)
returns new Mouseevent
with translated coordinates with given x,y
- pwheel
- {[int]} - previously wheel position of mouse
- px
- {[int]} - previous position of the mouse when mouseevent was produced
- py
- {[int]} - previous position of the mouse when mouseevent was produced
- set (MouseEvent self, int x,y,[wheel])
- returns: (MouseEvent)
returns new Mouseevent
with new coordinates set to x and y, respecting the previous
position.
- src
- {[int]} - source object that produced the mouseevent if available
- toString
- {string}:(MouseEvent e) - returns a string representing the mouseevent.
This function is called if the MouseEvent is converted to a string, i.e.
when calling 'print(mymouseevent)'.
- wheel
- {[int]} - wheel position of mouse
- wheelmove
- {[int]} - difference between current and previous wheelposition
- x
- {[int]} - position of the mouse when mouseevent was produced
- y
- {[int]} - position of the mouse when mouseevent was produced