You've seen the VPad (Virtual Joystick) for 3D Games with ShiVa, however you've always wanted to use a VPad for 2D Games and specifically with HUD items, but never had an actual VPad to do it. NOW There's a solution! After weeks and months coding daily and doing all kinds of crazy Calculus and Triginometry (Yea I actually went hardcore on the math) I'm proud to announce the first VPad for 2D HUD items! That's right! Now you can control a HUD item and make 2D games using only the HUD. This means FASTER games and Lower file sizes (In General) due to only HUD elements! It's simple to setup and has a LOT of really cool functionality!
1. Set the vPad Location (nPadLocation). Default is 4. Options are as follows:
0 = bottom left
1 = bottom right
2 = top left
3 = top right
4 = free movement
2. Set the component of the player (This is the component that will be moved) (sPlayerComponentName) Usually in your main HUD interface.
3. Set Player Rotation (bRotatePlayer). This is set to false by default, but you can set it to true as well if you wish for your player object to rotate angle wise as well as moving in all directions.
4. Set the maximum speed in units that the player can move if fully extending the joystick (nMaxSpeed). Default is 0.25, but based on what you want you can change this either directly in the AI or during actual gameplay using a send event.
Example (Before Runtime): Set AI Model Variable nMaxSpeed to any UNIT number value. For example the default is 0.25
Example (During Runtime From Another AI): user.sendEvent ( this.getUser ( ), "HUDJoystick", "onChangeSpeed", 0.25 )
Example (During Runtime from SAME AI): this.nMaxSpeed ( 0.25 )
5. Set the type of Joypad you want to use. There are 3 options:
0 = 360 Degrees (All Way Joystick)
1 = 8 Way Only (Top/TopRight/Right/BottomRight/Bottom/BottomLeft/Left/TopLeft)
2 = 4 Way Only (Up/Down/Left/Right)
Example (Before Runtime): Set AI Model Variable nPadType to any UNIT number value. For example the default is 0
Example (During Runtime From Another AI): user.sendEvent ( this.getUser ( ), "HUDJoystick", "onChangeJoypadType", 0 )
Example (During Runtime from SAME AI): this.nPadType ( 0 )
6. Set the size buffer of the joypad. This is the area that SURROUNDS the joypad that the user's finger can move and still be able to make the joypad move. Outside of this area the joypad will not move. Default is 8 (this.nSizeBuffer ( 8 ))