public final class MouseSwt extends Object implements Mouse, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseWheelListener
Constructor and Description |
---|
MouseSwt(org.eclipse.swt.widgets.Display display)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionPressed(int click,
EventAction action)
Add an action that will be triggered on pressed state.
|
void |
addActionReleased(int click,
EventAction action)
Add an action that will be triggered on released state.
|
int |
getClick() |
int |
getMoveX() |
int |
getMoveY() |
int |
getOnScreenX()
Get location on screen x.
|
int |
getOnScreenY()
Get location on screen y.
|
int |
getX() |
int |
getY() |
boolean |
hasClicked(int click) |
boolean |
hasClickedOnce(int click) |
boolean |
hasMoved() |
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent event) |
void |
mouseDown(org.eclipse.swt.events.MouseEvent event) |
void |
mouseMove(org.eclipse.swt.events.MouseEvent event) |
void |
mouseScrolled(org.eclipse.swt.events.MouseEvent event) |
void |
mouseUp(org.eclipse.swt.events.MouseEvent event) |
void |
setConfig(com.b3dgs.lionengine.core.Config config)
Set the config.
|
void |
update(double extrp) |
public MouseSwt(org.eclipse.swt.widgets.Display display)
display
- The display reference.public void setConfig(com.b3dgs.lionengine.core.Config config)
config
- The config.public void addActionPressed(int click, EventAction action)
Mouse
Alternative usage with classic programming style can be achieved with InputDevicePointer.hasClicked(int)
or
InputDevicePointer.hasClickedOnce(int)
.
addActionPressed
in interface Mouse
click
- The action key.action
- The action reference.public void addActionReleased(int click, EventAction action)
Mouse
Alternative usage with classic programming style can be achieved with InputDevicePointer.hasClicked(int)
or
InputDevicePointer.hasClickedOnce(int)
.
addActionReleased
in interface Mouse
click
- The action key.action
- The action reference.public int getOnScreenX()
Mouse
getOnScreenX
in interface Mouse
public int getOnScreenY()
Mouse
getOnScreenY
in interface Mouse
public int getX()
getX
in interface com.b3dgs.lionengine.core.InputDevicePointer
public int getY()
getY
in interface com.b3dgs.lionengine.core.InputDevicePointer
public int getMoveX()
getMoveX
in interface com.b3dgs.lionengine.core.InputDevicePointer
public int getMoveY()
getMoveY
in interface com.b3dgs.lionengine.core.InputDevicePointer
public int getClick()
getClick
in interface com.b3dgs.lionengine.core.InputDevicePointer
public boolean hasClicked(int click)
hasClicked
in interface com.b3dgs.lionengine.core.InputDevicePointer
public boolean hasClickedOnce(int click)
hasClickedOnce
in interface com.b3dgs.lionengine.core.InputDevicePointer
public boolean hasMoved()
hasMoved
in interface com.b3dgs.lionengine.core.InputDevicePointer
public void mouseScrolled(org.eclipse.swt.events.MouseEvent event)
mouseScrolled
in interface org.eclipse.swt.events.MouseWheelListener
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent event)
mouseDoubleClick
in interface org.eclipse.swt.events.MouseListener
public void mouseDown(org.eclipse.swt.events.MouseEvent event)
mouseDown
in interface org.eclipse.swt.events.MouseListener
public void mouseUp(org.eclipse.swt.events.MouseEvent event)
mouseUp
in interface org.eclipse.swt.events.MouseListener
public void mouseMove(org.eclipse.swt.events.MouseEvent event)
mouseMove
in interface org.eclipse.swt.events.MouseMoveListener
public void update(double extrp)
update
in interface com.b3dgs.lionengine.Updatable
Copyright © 2016 Byron 3D Games Studio. All rights reserved.