[FREE] Component tools extension

Hello every one :grin:,

Version 2.0 is now out :partying_face: :partying_face:

Thanks every one for your suggestions.I tried to consider it all in this update.If i missed to add any thing please tell me :slightly_smiling_face:
Actually i thought some time how to achieve gesture events in real-time without adding loads of code and blocks.Actually, i ended with only two blocks.
It only have one touched block. It have a parameter its name is action.It covers almost every valid action.Even clicks.Doable clicks can be detected by comparing the times that the touch event ACTION_UP and then ACTION_DOWN has been called.Long click can be detected by the time of the event. Also you can know how many thumbs clicked.And knowing coordinates of every thumb.And the click event.Also i considered @WatermelonIce, @ADDYLIN and @nandu_aeer voting’s.In a future update i will add the ability of setting a listener that detects touches in any place on the screen.

New blocks:

The extension have 4 new blocks. Based on your suggestions.

RegisterComponent
component_method (42)
Register component so the extension can detect touches on it.
Component ~ Component

Touched
component_event (18)
This event is triggerred when a component is touched.The action is returned in the action parameter.
Component ~ Component ( the component which is clicked )
info~ String ( A detailed info about the touch in json format )
x~ int ( X positions of the first touch place )
y~ int ( Y positions of the first touch place )
action ~ String ( Action name of the action occurred.)
Thanks for @Zia_Choudhary and @themaayur

Valid action types

ACTION_BUTTON_PRESS

ACTION_BUTTON_RELEASE

ACTION_CANCEL

ACTION_DOWN

ACTION_HOVER_ENTER

ACTION_HOVER_EXIT

ACTION_HOVER_MOVE

int ACTION_MASK

int ACTION_MOVE

ACTION_OUTSIDE

ACTION_POINTER_DOWN

ACTION_POINTER_INDEX_MASK

ACTION_POINTER_INDEX_SHIFT

ACTION_POINTER_UP

ACTION_SCROLL

ACTION_UP

SetZ
component_method (43)
Sets the Z position of any component you want.
Component ~ Component
z ~ int
Thanks for @broekmancompany

GetZ
component_method (44)
Gets the Z position of any component you want.
Component ~ Component
Thanks for @broekmancompany

Bug fixed

Only small bug with the extension icon.

Download link

io.mohamed.ComponentTools.aix (19.8 KB) (V2)

4 Likes