0 Favourites

Pseudo Analog touch-pad

  • Hi, i was looking in the forum for a good analog input for touchscreen but they were over complicated or have events that eventually bugs other inputs and layouts so i had this idea that worked fine and wanted to share

    It's not a great discover but for newbies like me could save a lot of time.

    First draw or get a pad sprite like this

    Then cut it in 4 like this

    You will get 4 pieces like this

    Now give 8dir behavior to your character and create the events

    On touch of each image -> simulate respective direction

    In the layout use the first image as a mask and then put the rest togheter overlaping.

    When you touch each button if you swipe your finger around it, it will work as a analog pad (kind of), it only use 4 events and has fast response to touch.

    Hope you it helps someone! (i deleted this post last time because images were not showing, now i'm using imgur if it doesnt work please advice me)

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I forgot, and it seems i can not edit:

    You can just do it with a blank image or 4 rectangles, then add an analog pad image with 8 animations and create 8 events to show respective animation when each combination of button is pressed.

  • A way to make it analogue easily is to set a center imagepoint and when touching the sprite, use X Y coords relative to the sprite's center to determine control power.

    Example:

    if touch touching analogue

    xAxis = touch.X - analogue.X / (analogue.Height / 2)

    yAxis = ..........

    You can get more complex with deadzones and such as well.

    touch.X - analogue.X gives the relative position of touch to analogue. Dividing by 2 gives half the height of the analogue sprite (which you would change to a more reliable value)

  • A way to make it analogue easily is to set a center imagepoint and when touching the sprite, use X Y coords relative to the sprite's center to determine control power.

    Example:

    if touch touching analogue

    xAxis = touch.X - analogue.X / (analogue.Height / 2)

    yAxis = ..........

    You can get more complex with deadzones and such as well.

    touch.X - analogue.X gives the relative position of touch to analogue. Dividing by 2 gives half the height of the analogue sprite (which you would change to a more reliable value)

    I search for this in the forums and many people solved it like this but in-game anda android the analogue usually bugs and ends up requiring extra effort.

    Most of people working in a proyect only want to move an object without so much precition but with the idea that you dont leave the touch of the buttons. The first thing you think about is an analog but this way you can solve this movement easily without risk.

    The objetive behind this is not touching the "move" buttons once and again, so this is a pseudo analog touch-pad.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
To All The Pseudo-Companies
36 4,865
Silverforce's avatar
Silverforce
Unread hot topic
0 Favourites
Trouble with pseudo Z axis
34 2,736
Arcticus's avatar
Arcticus
Unread hot topic
26 2,327
part12studios's avatar
part12studios