Page 1 of 1

Drawing simple vector graphics

Posted: Mon Aug 27, 2012 10:37 pm
by ErwinVJ
Hi there, as per title of this forum, I'm a beginner and I need to find a solution for the following:

I want users to draw basic forms - limited to lines, circles and rectangles - to make a simplified visual representation of their garden. They should be able to select the forms from a menu and position the element on a 'canvas'. Each element can get a name-tag and height attribute and should be size-able in either Metric or other format.
After the element is drawn, the user should be able to move, rotate or re-size the element and enter/edit its name tag.


Some attributes that are nice to have: repositioning element using
- snap function (make vertices of the rectangles/lines snap to other vertices nearby for better alignment)
- repositioning and rotating using values instead of 'by hand'

Can I achieve this in LiveCode? Is there a tutorial, explanation, script, plugin available that I can use?

Thanks,
Erwin

Re: Drawing simple vector graphics

Posted: Wed Aug 29, 2012 12:47 pm
by jmburnod
Hi ErwinVJ,

Yes, you can do it with LiveCode
Is there a tutorial, explanation, script, plugin available that I can use?
I search and i'll come back

Best regards

Jean-Marc

Re: Drawing simple vector graphics

Posted: Wed Aug 29, 2012 5:28 pm
by FourthWorld
In the dictionary see the tool global property, the grid and gridSize global properties, and the rectangle object property, all controllable via script.

Note that the IDE eats some mouse-related messages when the pointer tool is the active mode, so sometimes when building a custom drawing environment you may need to suspend the IDE while testing.

Re: Drawing simple vector graphics

Posted: Wed Aug 29, 2012 11:02 pm
by jmburnod
Hi ErwinVJ,

I put in attachment the Carl Manaster's tangram where you can see some useful scripts for your project
and particulary to rotate polygon

Best regards

Jean-Marc