[B4X]Connecting the buttons (or other views)

PaulMeuris

Well-Known Member
Licensed User
In this tutorial you can study the source code to see how you can connect buttons (or other views) with lines.

The source code is almost identical in B4A and in B4J.
In the source code i use a rectangle to determine the direction of the line.
This direction is then used to set the start and end position on the edge of the button.
For the button properties and for the line properties i use maps.
The button properties map is used to detect entering the button area.
You can find the sourcecode in the attachments (B4A: testenvironment42 and B4J: testenvironment49).
This code can be used in an application where you want to connect for instance nodes in a peer-to-peer network.
If you think you can do this another way then feel free to share your code in this thread.
 

Attachments

  • 1704627564203.png
    30.7 KB · Views: 133
  • 1704627625028.png
    81.6 KB · Views: 124
  • testenvironment42.zip
    12.8 KB · Views: 119
  • testenvironment49.zip
    5.5 KB · Views: 136
Cookies are required to use this site. You must accept them to continue using the site. Learn more…