1

I want to create a visual editor, where you can connect data interfaces of different components by wires which defines the dataflow between them. It should be something like for example blender node editor. Below I have added a picture that shows the principle.

Formal example of editor interface

The problem I'm currently facing with is to make the wire clickable. One idea is, to create a View for each wire with a dynamically drawn line. But in this scenario, the touch area will be too big because Android handles Views as rectangular widgets and in case of multiple wires I will get overlaying wires and so I cannot resolve the touched wire precisely. Do you have an idea how I can test if the touch point crosses a wire or not (with android lib classes, maybe Path)? What I additionally have to say, that the wire should be a bezier spline.

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
Sebastian
  • 11
  • 1

1 Answers1

0

If you want the wire to a bezier curve, see: Bezier curve and canvas

which would mean that everything is in a Canvas and you are responsible for drawing and handling touch events.

A starting point on some expected actions: Drag and move a circle drawn on canvas

Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77