|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgestalt.render.MinimalRenderer
gestalt.render.BasicRenderer
gestalt.render.AnimatorRenderer
gestalt.demo.basic.UsingEventHandling
public class UsingEventHandling
this demo shows how to obtain mouse and key events there are two different ways to obtain events. 1 event model implement the 'GestaltKeyListener' and/or 'GestaltMouseListner' interfaces when event methods are invoked, the mouse coordinates and pressed keys are passed as argument 2 polling poll the EventHandler 'event' event.mouseX event.mouseY event.keyDown event.keyCode ... to use this demo, move the mouse over the window and press numbers 1 - 9
| Field Summary |
|---|
| Fields inherited from class gestalt.render.MinimalRenderer |
|---|
WORKAROUND_FORCE_QUIT |
| Constructor Summary | |
|---|---|
UsingEventHandling()
|
|
| Method Summary | |
|---|---|
void |
keyPressed(char theKey,
int theKeyCode)
override this method to receive key events. |
void |
keyReleased(char theKey,
int theKeyCode)
override this method to receive key events. |
void |
loop(float theDeltaTime)
override this method to get a loop. |
static void |
main(java.lang.String[] arg)
|
void |
mousePressed(int x,
int y,
int thePressedMouseButton)
override this method to receive mouse events. |
void |
mouseReleased(int x,
int y,
int thePressedMouseButton)
override this method to receive mouse events. |
void |
setup()
override this method to setup things. |
| Methods inherited from class gestalt.render.AnimatorRenderer |
|---|
addToRenderLoop, cameramover, finish, fixFramerate, fpscounter, framerate, getCurrentFramerate, getDesiredFramerate, init, init, init, init, loop, quit, renderloop, start, stop, update |
| Methods inherited from class gestalt.render.BasicRenderer |
|---|
camera, create, dispose, fog, framefinish, framesetup, light, origin, replaceCamera, set3DFinishRef, setBinRef, setCameraRef, setFogRef, setFramefinishRef, setFramesetupRef, setLightRef, setOriginRef, setupDefaultRenderbins, toString |
| Methods inherited from class gestalt.render.MinimalRenderer |
|---|
bin, bin, createDisplayCapabilities, display, displaycapabilities, drawablefactory, event, setDisplayRef, setDrawablefactoryRef, setEventRef, updateDisplayCapabilities |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UsingEventHandling()
| Method Detail |
|---|
public void setup()
AnimatorRenderer
setup in interface Loopablesetup in class AnimatorRendererpublic void loop(float theDeltaTime)
AnimatorRenderer
loop in class AnimatorRenderertheDeltaTime - float duration of the last frame in seconds.
public void mousePressed(int x,
int y,
int thePressedMouseButton)
BasicRenderer
mousePressed in interface GestaltMouseListenermousePressed in class BasicRendererx - inty - intthePressedMouseButton - int
public void mouseReleased(int x,
int y,
int thePressedMouseButton)
BasicRenderer
mouseReleased in interface GestaltMouseListenermouseReleased in class BasicRendererx - inty - intthePressedMouseButton - int
public void keyPressed(char theKey,
int theKeyCode)
BasicRenderer
keyPressed in interface GestaltKeyListenerkeyPressed in class BasicRenderertheKey - chartheKeyCode - int
public void keyReleased(char theKey,
int theKeyCode)
BasicRenderer
keyReleased in interface GestaltKeyListenerkeyReleased in class BasicRenderertheKey - chartheKeyCode - intpublic static void main(java.lang.String[] arg)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||