Page 1 of 1

Image,Vertices,Bodies Alignment, tiling, more...

Posted: Wed Oct 30, 2013 2:35 pm
by nuko4noji
There is a function of these

Print Info
Cursor Move
Cursor Move to Edge
Move Relative
Move to Cursor TOP/MIDDLE/BOTTOM
Move to Cursor LEFT/CENTER/RIGHT
Align to Cursor TOP/MIDDLE/BOTTOM
Align to Cursor LEFT/CENTRE/RIGHT
Align Uniform Horizon
Align Uniform Vertical
Tile Glow from Cursor
Image Scale Fix
Image Name By File
Body Center Fix
Body Center Move To Cursor
Vertices Reverse X
Vertices Reverse Y
Vertices Index Rotate Plus
Vertices Index Rotate Minus
Vertices Index Rotate Reverse

Demonstration
http://www.youtube.com/watch?v=Rn__knu7Tsc

Script Download
http://dls.ma.cx/MyCustomMenu.zip

Re: Image,Vertices,Bodies Alignment, tiling, more...

Posted: Thu Oct 31, 2013 10:09 am
by iforce2d
Wow, that's a lot of stuff, nice work!
If you could add a link to this forum thread in the YouTube video description, then people can find the script download from the video too.

Re: Image,Vertices,Bodies Alignment, tiling, more...

Posted: Thu Oct 31, 2013 10:37 am
by iforce2d
ah, did you develop these on Windows? The script file names are case-sensitive on Linux and Mac.
So if the script file name is "PrintInfo.rs", then in the layout.json file it should also be "PrintInfo.rs", not "printInfo.rs".

ImageNameByFile is a great idea, you could set that to run after dropping images into the scene... much better than the default names of 'image3', 'image4' etc :)

One thing that would make it easier for people when they first try these, is to set the minBodies, minFixtures etc values in layout.json. This will make the menu items grayed out for scripts that cannot be used when the appropriate items are not selected. Search the help for "minBodies" to find the topic about that, and see the layout.json file of the default menu for some usage examples (eg. add joint requires two bodies to be selected).

By the way, a few things to point out:
- there are dr(float) and rd(float) global functions to convert between degrees and radians
- shape::getRadius() is implemented now
- spelling should be 'grow', not 'glow' :P

I like how you have grouped item types into an 'Element' class for generic operations... awesome!

Re: Image,Vertices,Bodies Alignment, tiling, more...

Posted: Fri Nov 01, 2013 6:25 am
by nuko4noji
Embarrassing spelling errors.
Was fixed whatnot.