Drawing simple vector graphics

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ErwinVJ
Posts: 6
Joined: Sun May 29, 2011 1:05 am

Drawing simple vector graphics

Post by ErwinVJ » Mon Aug 27, 2012 10:37 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Drawing simple vector graphics

Post by jmburnod » Wed Aug 29, 2012 12:47 pm

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
https://alternatic.ch

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Drawing simple vector graphics

Post by FourthWorld » Wed Aug 29, 2012 5:28 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Drawing simple vector graphics

Post by jmburnod » Wed Aug 29, 2012 11:02 pm

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
Attachments
tangram.rev.zip
(17.71 KiB) Downloaded 331 times
https://alternatic.ch

Post Reply