I want to build a small circuit modeling tool, just like a little "Circuit Lab", with Ext JS.
There will be different electric components which can be dragged and dropped on a drawing surface and can be connected with wires. These electric component have different connections points, where a wire can st I already tried the last days, but I got stuck at the connection points on the edge of the electric components, from which I can start drawing a wire.
My approach was:
The whole drawing area is a Ext.draw.Component, the electric components are draggable Sprites on this drawing surface.
The problem with that approach is: The connection points are at different positions on every different electric component. When I change the position of a electric component via dragging and dropping, the connection points have to change their position on the surface, too, of course.
So I tried to pack every electric component, together with its connection points - also Sprites - and their positions relative to the center of the component, into a CompositeSprite. But unfortunately, that didn't solve any problems.
So... How would you start, if you wanted to build something like that?
Maybe the whole drawing-area should be a normal Panel, and every electric component is a (draggable) Ext.draw.Component inside this Panel (not only a Sprite) ? Or any different approaches?
I already tried a lot, but I couldn't get to any working conclusion.
I'm very pleased about your thoughts about that topic!