Page 1 of 1

How to merge tools?

Posted: Mon Mar 01, 2010 9:05 am
by Vagabond
I had an idea for an improved Select Shape tool.

A regular LMB click would select the shape
Holding down shift +LMB would select more than one shape so I could hit the spacebar and make them one shape like how text is one style

ALT+LMB would push both Fill and Stroke
ALT+RMB would push stroke only

CTRL+LMB would push the fill only
Holding down CTRL + dragging the RMB will change the line width

I've never scripted before but is there a way I could at least copy the Line Width tool into the Select Shape tool? I know I'm clueless and am probably talking crazy. Since the User's Manual doesn't even have a paragraph on basic Lua I wouldn't know where to start. Any suggestions?

Posted: Tue Mar 02, 2010 12:59 am
by rylleman
First get a good code editor that highlights syntax etc. so you more easily can see what you are doing. Scite is a good cross platform one.

Open up both scripts you want to merge in the editor, then copy/paste between them. Study different scripts and figure out how it all works.

There's some documentation for lua scripting if you dig around here at the forum:
viewtopic.php?t=11627&highlight=lua+reference
viewtopic.php?t=1031
http://www.lua.org/manual/5.0/manual.html

Good luck! Hope you'll manage to do what you want.

Posted: Mon Mar 15, 2010 8:28 am
by Vagabond
THANK YOU rylleman. You have definitely put me on the right track with learning scripting. Scite looks like a great programming sandbox to start playing in too. Hopefully I will be able to contribute something to the forum soon.