Specials
Top sellers

JPShortcut

JPShortcut
Product Code: jpshortcut
Availability: In Stock
Built for: Associate your game actions with customizable shortcuts (keys, mouse/joypad buttons).
Product Version: 1.2
Online Demo: http://www.julien-pierron.com/sample.php?sample=jpshortcutsample
Forum Link: http://www.shivaengine.com/developer/forum/viewtopic.php?f=82&t=29258
Req. ShiVa Version: ShiVa 1.9.2 Engines
Plugin Platform Compatibility: iOS, Android, WinRT ARM/Phone 8, WinRT x86/_64, Windows Legacy, Mac OS X, Linux, Flash, Web Browser, Palm, Marmalade, BlackBerry, Windows Phone 7, Playstation 3, Playstation 4, Xbox 360, Xbox One, Wii
Price: $39.00
Seller information: Julien Pierron
Country: France, Metropolitan
Company: Julien Pierron
Qty:     - OR -   Wish List
Compare
In your game, when you want to do an action like moving a character, you will be listening to the keyboard events, to know if the key to move forward, backward or to start a specific action is pressed or released. That's great, but as soon as you allow the user to customize the actions key, it becomes much more complicated.

With JPShortcut, you will be listening for action events instead of keys. JPShortcut will send you events to let you know when an action shortcut is pressed or released, whatever the shortcut is.

JPShortcut embeds functions to be called by your shortcut editor interface. Tell JPShortcut that the "Forward" action has been clicked by the user to be edited, and JPShortcut will automatically change the shortcut as soon as a new key is pressed, and will notify you of the new key to let you update the interface with the new action key name.

JPShortcut is compatible with mouse buttons as well as joypad buttons.

Here is a quick example, starting from the setup step:

-------------------------------------------------
function JPShortcutSample.onInit ( )
-------------------------------------------------

JPShortcut.createAction ( "Forward", input.kKeyUp )
JPShortcut.createAction ( "Backward", input.kKeyDown )
JPShortcut.createAction ( "Left", input.kKeyLeft )
JPShortcut.createAction ( "Right", input.kKeyRight )
JPShortcut.createAction ( "Crouch", input.kKeySpace ) --Special action

-------------------------------------------------
end
-------------------------------------------------

Here's the code if you want to do something as long as the action shortcut is pressed:

-------------------------------------------------
function JPShortcutSample.onEnterFrame ( )
-------------------------------------------------

if ( JPShortcut.isActionShortcutDown ( "Forward" ) )
then
--Move forward
end

--Same for the other actions

-------------------------------------------------
end
-------------------------------------------------

And here the code for actions called once, in the onActionShortcutPressed (or Released) handler, automatically called by JPShortcut when the action is triggered:

-------------------------------------------------
function JPShortcutSample.onActionShortcutPressed ( sAction )
-------------------------------------------------

if ( sAction == "Crouch" )
then
--do the crouch action
end

-------------------------------------------------
end
-------------------------------------------------

In these 2 cases, even if the shortcut changes, your script remain the same as it is looking for actions state instead of keys or buttons states.

Requirements:
- ShiVa 1.9.2 or greater´╗┐´╗┐´╗┐
- LUA project (not compatible with full c++ projects, compatible with LUA projects that use c++ plugins)

You can find an introduction to the packs and how to load them in your game here:
http://www.julien-pierron.com/shiva-store.php

API & Instructions
http://www.julien-pierron.com/product-api.php?product=jpshortcut

Changelog
http://www.julien-pierron.com/product-changelog.php?product=jpshortcut

Sample projects that use my packs
http://www.julien-pierron.com/samples.php

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



ShiVa Store © 2018 - Powered By OpenCart