JPInput

JPInput

Collecte les valeurs relatives aux inputs de l'appareil.
Version : 2.0
Prix : $20
Etat : Épuisé

Liste des modifications

v2.0

  • Now compatible with ShiVa 2.0.
  • Plugin API compiled for Mac and Linux in addition to Windows : it will provide API completion in the Script module in ShiVa Editor for each of these operating systems.
  • Now uses a user token instead of an email to activate

v1.5

  • Added function removeUser ( hUser )

v1.4

The following functions now return the press duration if the key/button is pressed:

  • bYes, nDuration = JPInput.isKeyboardKeyDown ( kKeyCode )
  • bYes, nDuration = JPInput.isMouseButtonDown ( nButton )

v1.3

New feature: Smoothed input values, starting with the onJoypadMove values: JPInput.setJoypadMoveSmoothingEnabled ( bEnabled, nOptCoef ) To get the smoothed values, implement the onJoypadMoveSmoothed handler, same parameters as the original onJoypadMove.

v1.2

  • Optimized for ShiVa 1.9.2

v1.1

  • function JPInput.getMouseAverage changed to: nAverageSpeedX, nAverageSpeedY = JPInput.getMouseAverageSpeed ( )

API

--JPInput JPInput.activate ( sUserToken, sActivationKey ) JPInput.addUser ( hUser ) JPInput.removeUser ( hUser ) --RETRIEVE VALUES --Mouse x, y = JPInput.getCursorPosition ( hOptUser ) bYes, nDuration = JPInput.isMouseButtonDown ( hOptUser, nButton ) nAverageSpeedX, nAverageSpeedY = JPInput.getMouseAverageSpeed ( hOptUser ) --Keyboard bYes, nDuration = JPInput.isKeyboardKeyDown ( hOptUser, kKeyCode ) --Joypad nPressure = JPInput.getJoypadButtonPressure ( hOptUser, nJoypad, nButton ) bState = JPInput.getJoypadButtonState ( hOptUser, nJoypad, nButton ) nPointX, nPointY, nDeltaX, nDeltaY, nRayPntX, nRayPntY, nRayPntZ, nRayDirX, nRayDirY, nRayDirZ = JPInput.getJoypadIRPointerState ( hOptUser, nJoypad, nPointer ) nX0, nY0, nS0, nX1, nY1, nS1, nX2, nY2, nS2, nX3, nY3, nS3 = JPInput.getJoypadIRState ( hOptUser, nJoypad, nSensor ) nAxisX, nAxisY, nAxisZ = JPInput.getJoypadState ( hOptUser, nJoypad, nPart ) nAxisX, nAxisY = JPInput.getJoypadStickState ( hOptUser, nJoypad, nStick ) --MultiTouch (requires JPMultiTouch) bTouching, nPositionX, nPositionY = JPInput.getTouchInputState ( hOptUser, nIndex ) --SMOOTHED VALUES --Joypad JPInput.setJoypadMoveSmoothingEnabled ( bEnabled, nOptCoef )

Description

JPInput est le pack à avoir si vous voulez facilement connaitre l'état des différents input de l'appareil.

Il n'est plus nécessaire d'implémenter les handlers de la souris, du clavier ou du joypad pour connaitre l'état de ces différentes sources. JPInput fourni des fontions que vous pouvez appeler de n'importe où qui vont vous donner ces valeurs.

Par exemple :

--Mouse bYes = JPInput.isMouseButtonDown ( nButton ) --Keyboard bYes = JPInput.isKeyboardKeyDown ( kKeyCode ) --Joypad bState = JPInput.getJoypadButtonState ( nJoypad, nButton ) nAxisX, nAxisY, nAxisZ = JPInput.getJoypadState ( nJoypad, nPart ) nAxisX, nAxisY = JPInput.getJoypadStickState ( nJoypad, nStick )

Note : JPInput peut également fournir les valeurs liées au multi touch. Cette fonctionalité requiert le pack JPMultiTouch.