Specials
Top sellers

JPButton

JPButton
Product Code: jpbutton
Availability: In Stock
Built for: Significantly improves the HUD buttons default behavior
Product Version: 2.0
Online Demo: http://www.julien-pierron.com/sample.php?sample=jpdemo
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: $26.00
Seller information: Julien Pierron
Country: France, Metropolitan
Company: Julien Pierron
Qty:     - OR -   Wish List
Compare
JPButton replaces the default ShiVa behavior for "onClicked" event of HUD buttons which stupidly trigger the event when the user's finger (or mouse) is released over the button.

JPButton will inform you in real time when the button state changes: normal or pressed state. When the user places his finger on a button, it enters the state "pressed". Now if, without releasing his finger, the user moves his finger on the screen farther or closer to the button, it will switch between "normal" and "pressed" states according to distance between the finger and the button's area.

JPButton does much more: it also checks if the button has not been moved, for example if it is present in a list, in order not to trigger the event if it was moved because of the list scrolling causing the button to remain under the user's finger.

All this is automatic, the event is triggered by JPButton. All you have to do (if you want to) is to implement the "onButtonDidEnterNormalState" and "onButtonDidEnterPressedState" handlers in order to animate your buttons, for example by changing their color to make them darker when pressed. Even better, you can use it with JPSprite to set a specific sprite for each of the button states:

--------------------------------------------------------------------------------------------------------------
function MyAIModel.onButtonDidEnterNormalState ( sButton )
--------------------------------------------------------------------------------------------------------------
JPSprite.setComponentSprite ( sButton, "button_normal_sprite" )
--------------------------------------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
function MyAIModel.onButtonDidEnterPressedState ( sButton )
--------------------------------------------------------------------------------------------------------------
JPSprite.setComponentSprite ( sButton, "button_pressed_sprite" )
--------------------------------------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------------------------------------

JPButton also allows you to enlarge the area of effect of your buttons, which is very convenient for small buttons (or for the large fingers...).

But wait, that's not all, by combining JPButton with JPMultitouch, you provide to your HUD buttons the possibility to be used in multitouch, I mean you will be able to click on several buttons at once. Very convenient for games using a virtual game pad, for instance! There's nothing else to do than to add these 2 packs to your game and call JPButton.enableMultitouch ( true ) and it will work like a charm!

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=jpbutton

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

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