Level Director - Level creation tool for windows

Just to confirm that I tried exporting a scaled image with a polygon physics body and it appeared to work correctly.

Steps;

  1. Add an image
  2. Scaled the image
  3. Mapped a polygon body to the scaled image
  4. export

Note: If you’re not using a polygon shape body then I believe that Corona/box2d will not automatically scale the standard rectangle body for you.

On a different note I have also added Joints to the wish list.

Thanks.
[import]uid: 175213 topic_id: 30669 reply_id: 134870[/import]

The problem is when it’s not a polygon shape, it’s when you don’t even set a shape, like the default rectangle.

The only way I can think for a solution is to set the new width and height of the display object before adding the physics body

Also, another feature I’d like would be a visual radius, for round assets. [import]uid: 53195 topic_id: 30669 reply_id: 134890[/import]

I think I know what you mean now, I’ll add ‘masks’ to the list.

How did you get on exporting your scaled and rotated images, are they ok now?
[import]uid: 175213 topic_id: 30669 reply_id: 134623[/import]

That’s what I thought and this is a limitation of Corona i.e. it does not scale the physics bodies.
The workaround is to use polygons and map the body to your scaled image.

A visual aid for round objects is already there.
Under the physics properties for your object set the body shape to ‘Round’ and then click ‘Edit shape’ it should show you your image with a circle overlay based on the radius which you can modify at the top.

You can also see the body shapes for a layer by clicking on the layer in the tree list and under the layer properties tick ‘Show Bodies’. [import]uid: 175213 topic_id: 30669 reply_id: 134894[/import]

Graphically, it works perfectly. But it looks like the scale doesn’t scale the size of the physics body, just the display object.

I don’t need it anymore, since I already got my resized spritesheet, that was an old, smaller one I was testing with. But it would still be great if you could fix that. ^^ [import]uid: 53195 topic_id: 30669 reply_id: 134627[/import]

I had the same issue but I will try this again. [import]uid: 158620 topic_id: 30669 reply_id: 134646[/import]

In theory this should work if the points are mapped to the scaled image but I will check to make sure this works. [import]uid: 175213 topic_id: 30669 reply_id: 134647[/import]

Found another small bag that you should fix asap, when exporting a physics object with a double number in the density, friction, bounce, and I’m guessing pretty much any other property, it exports it with a comma, which doesn’t work. Corona needs it with a dot.

This is an example of what was exported:

[lua] physics.addBody(level.layers[“New Layer”].objects[“rect_1”],“static”,{density = 1, friction = 0,7, bounce = 0,3}) [/lua]

And this is what is needed

[lua]physics.addBody(level.layers[“New Layer”].objects[“rect_1”],“static”,{density = 1, friction = 0.7, bounce = 0.3})[/lua]

Just change the ‘,’ for ‘.’ when exporting ^^ [import]uid: 53195 topic_id: 30669 reply_id: 135155[/import]

I’ve had some really good feedback after releasing v1.7 which saw the addition of Bezier curves but going forward I would really like to hear what new features you would like to see.

Currently on my list are;

  1. Button objects.
  2. Code snippets.
  3. Add gravity scale to physic properties.
  4. Scene Director - allow multiple Levels/scenes to be managed at once
  5. New API style export.
  6. Create some video tutorials
  7. Update documentation.
  8. Option to flip objects including Bezier Curves.
  9. Add physic bodies to curves.
  10. Support Widget Objects.
  11. Custom Vector objects.
  12. Masks
  13. Joints

I look forward to hearing your suggestions.

Thanks
J.

[import]uid: 175213 topic_id: 30669 reply_id: 134499[/import]

Just to confirm that I tried exporting a scaled image with a polygon physics body and it appeared to work correctly.

Steps;

  1. Add an image
  2. Scaled the image
  3. Mapped a polygon body to the scaled image
  4. export

Note: If you’re not using a polygon shape body then I believe that Corona/box2d will not automatically scale the standard rectangle body for you.

On a different note I have also added Joints to the wish list.

Thanks.
[import]uid: 175213 topic_id: 30669 reply_id: 134870[/import]

Hi,

I just tried it and it exported ok for me so I wonder if it is a localization issue i.e. windows maps dot/period as comma.

I’ll look into this as regardless of localiztion it should export as a dot. [import]uid: 175213 topic_id: 30669 reply_id: 135160[/import]

It might be a localization then, the level editor doesn’t even let me write it with a dot, it says “0.7 is not a valid value for Double”.

Edit: It was my PC, I just changed it in Control Panel -> Region and Language -> Formats. I had the default decimal symbol as a comma. It’s working now [import]uid: 53195 topic_id: 30669 reply_id: 135166[/import]

The problem is when it’s not a polygon shape, it’s when you don’t even set a shape, like the default rectangle.

The only way I can think for a solution is to set the new width and height of the display object before adding the physics body

Also, another feature I’d like would be a visual radius, for round assets. [import]uid: 53195 topic_id: 30669 reply_id: 134890[/import]

That’s what I thought and this is a limitation of Corona i.e. it does not scale the physics bodies.
The workaround is to use polygons and map the body to your scaled image.

A visual aid for round objects is already there.
Under the physics properties for your object set the body shape to ‘Round’ and then click ‘Edit shape’ it should show you your image with a circle overlay based on the radius which you can modify at the top.

You can also see the body shapes for a layer by clicking on the layer in the tree list and under the layer properties tick ‘Show Bodies’. [import]uid: 175213 topic_id: 30669 reply_id: 134894[/import]

Cool I’m pleased you figured it out.

Also did you find the shape editor I mentioned with regards to viewing the circle body? [import]uid: 175213 topic_id: 30669 reply_id: 135240[/import]

Looks cool.

i’ll check this out as well, I have windows and mac so I’ll be all over this - right after vacation… :slight_smile:

Larry [import]uid: 11860 topic_id: 30669 reply_id: 135241[/import]

Yeah, I saw the circle editor, works great.

Another feature that I don’t really need right now, but would still be cool to have in the future would be multi-element or complex bodies editor [import]uid: 53195 topic_id: 30669 reply_id: 135253[/import]

Yes joints and complex bodies are on my list, just need to spec it out and find some time…
[import]uid: 175213 topic_id: 30669 reply_id: 135256[/import]

Found another small bag that you should fix asap, when exporting a physics object with a double number in the density, friction, bounce, and I’m guessing pretty much any other property, it exports it with a comma, which doesn’t work. Corona needs it with a dot.

This is an example of what was exported:

[lua] physics.addBody(level.layers[“New Layer”].objects[“rect_1”],“static”,{density = 1, friction = 0,7, bounce = 0,3}) [/lua]

And this is what is needed

[lua]physics.addBody(level.layers[“New Layer”].objects[“rect_1”],“static”,{density = 1, friction = 0.7, bounce = 0.3})[/lua]

Just change the ‘,’ for ‘.’ when exporting ^^ [import]uid: 53195 topic_id: 30669 reply_id: 135155[/import]

Hi,

I just tried it and it exported ok for me so I wonder if it is a localization issue i.e. windows maps dot/period as comma.

I’ll look into this as regardless of localiztion it should export as a dot. [import]uid: 175213 topic_id: 30669 reply_id: 135160[/import]