Physics Shape Panel for Adobe Fireworks

Hi everyone,

Just wanted to let you all know about a new tool I’ve just released, a panel for Adobe Fireworks that makes it quick and easy to generate a custom shape table for use in physics bodies. If you need to create an irregularly-shaped physics body, all you need to do is use the vector drawing tools in Fireworks to draw the custom shape you want to use, and the panel will generate a table that you can plug into your physics.addBody() method call.

You can download the extension and get more information about it from the Ludicrous Software website: Corona Physics Shape Panel for Fireworks.

Let me know if you try the panel and have any feedback. It’s a very early release, but it works well and will hopefully save you some time!

Thanks!
Darren [import]uid: 1294 topic_id: 4864 reply_id: 304864[/import]

Do you mind if I say I <3 U :slight_smile:
This is simply AWESOME!!!

RD [import]uid: 7856 topic_id: 4864 reply_id: 15653[/import]

Thanks. This is really cool. [import]uid: 8192 topic_id: 4864 reply_id: 15680[/import]

Thanks so much, a real time saver! [import]uid: 10426 topic_id: 4864 reply_id: 15684[/import]

Wow awesome !

[import]uid: 24 topic_id: 4864 reply_id: 15705[/import]

hi,

great stuff thanks

it’d be good if you could integrate this into it (or another panel):
http://developer.anscamobile.com/forum/2010/11/03/physics-complex-polygon-tool

obviously it’s a bit more complex but there’s already JSFL code there with the algorithm required so presumably that could be ported from Flash to Fireworks?

regards
j

[import]uid: 6645 topic_id: 4864 reply_id: 15713[/import]

It would probably be possible to approximate what that JSFL script does by taking a compound or other complex path drawn in Fireworks and create the complex body code for use in Corona. Also, it would probably be fairly straightforward to take a path with more than 8 points and create a complex body from all those points.

Perhaps one of these days I’ll take a look at that!

Thanks,
Darren [import]uid: 1294 topic_id: 4864 reply_id: 16140[/import]

Thank you so much.

You have saved me a lot of headaches [import]uid: 6981 topic_id: 4864 reply_id: 16713[/import]

You know how in life there are a few things that have the potential to really make your day?.. Like… I don’t know, a good book, a great movie, a beautiful sunset… This extension… :smiley: [import]uid: 13720 topic_id: 4864 reply_id: 16891[/import]

Every time I run the extension it tells me an error has occurred D:

[import]uid: 10355 topic_id: 4864 reply_id: 17411[/import]

Is it giving you any kind of error message, or just a generic error? [import]uid: 1294 topic_id: 4864 reply_id: 17421[/import]

Verbatim: Could not run the script. An error has occurred.

Im running CS5 in OSX 10.6 … and ive done everything your instructions said. Eh maybe its just me. This this would have saved me hours and hours of work. [import]uid: 10355 topic_id: 4864 reply_id: 17422[/import]

SICK I haven’t developed an app YET…but I can see how this will become extremely useful. Thank you so much! Can’t wait to start/finish my first app. [import]uid: 22559 topic_id: 4864 reply_id: 17437[/import]

Evna: if you can, email me your Fireworks PNG file (i.e. with the polygon that you want to use as your shape included in the file), and I’ll take a look to see if it works for me. My email is darren@ludicroussoftware.com.

Thanks!
Darren [import]uid: 1294 topic_id: 4864 reply_id: 17479[/import]

Hey everyone I wrote something similar in MATLAB before I found this (dont have Fireworks either) if you have MATLAB hope this helps, if not I can try to compile it into either a .exe or a .app

John

EDIT: Looks I’d only be able to compile in .exe which kinda sucks…

[code]
function outStr = getImagePoints(filename, n, scale)
% Instructions:
% When the figure window appears place the cursor over the image and click
% where you want the edge points to be, after you have selected ‘n’ points
% (maximum of 8) the figure will disappear and the text string will appear.
% Only works with *.png images currently.
%
% Points must be chosen in a counter-clockwise direction or will not be
% compatible with Corona!
%
% Inputs:
% filename - path to file (png works best)
% n - number of points to take
% scale - if the image in Corona is half then use .5 if it is twice the
% size use 2
%
% Maximum number of points: 8

if n > 8
error(‘Maximum number of points: 8’)
elseif ~strcmp(filename(end-3:end), ‘.png’)
error(‘Not a *.png file’)
end

% Import the image data
img = importdata(filename);
imgFields = fieldnames(img);

% Plot the image
if strcmp(imgFields{2}, ‘alpha’)
image(‘CData’, img.cdata, ‘AlphaData’, img.alpha)
else
imshow(img.cdata,img.colormap)
end

% Draw a line through the center of the image in each axis
%hold on
%plot([0 0], [-10 10])

% Convert the values from x and y into the Corona coordinate system
xdim = size(img.cdata,2);
ydim = size(img.cdata,1);

% Draw a line through the center of the image in each axis
hold on
plot([xdim/2 xdim/2], [0 ydim])
plot([0 xdim], [ydim/2 ydim/2])

% Get the points from the user
[x y] = ginput(n);
xlim([0 xdim]);
ylim([0 ydim]);
close all

x_out = round((round(x) - xdim/2)*scale);
y_out = round((round(y) - ydim/2)*scale);

% Format the points to match the Corona syntax
outStr = 'ObjShape = { ‘;
for i = 1:numel(x_out)
if i == numel(x_out)
outStr = [outStr num2str(x_out(i)) ‘,’ num2str(y_out(i)) ’ }’];
else
outStr = [outStr num2str(x_out(i)) ‘,’ num2str(y_out(i)) ', '];
end
end
[/code] [import]uid: 17878 topic_id: 4864 reply_id: 24322[/import]