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

Let us know if you have a nice R.U.B.E script to share!
Post Reply
nuko4noji
Posts: 2
Joined: Wed Oct 30, 2013 1:56 pm

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

Post 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
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

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

Post 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.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

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

Post 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!
nuko4noji
Posts: 2
Joined: Wed Oct 30, 2013 1:56 pm

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

Post by nuko4noji »

Embarrassing spelling errors.
Was fixed whatnot.
Post Reply