dynamic shapes....please please please....

is there a way to access and change the vertices on a shape object after creation?

with the cool new fill/paint stuff this would be really useful…  :)

cheers

andy

The amazing horacybury created a nice utility for this functionality in the Code Exchange:

http://developer.coronalabs.com/code/body-modification

thanks , this isn’t quite what i mean though

not necessarily changing a physics object, but the shape object itself…

ie . create a polygon or multiline, then fill it with a pattern, then animate the vertices.

for example, to create a lightning bolt i would draw a line and append more verts to it, then on each subsequent frame add random movement to the vertices. 

Hmm… so you aren’t looking to changing the shape after creation, but changing a shape. 

You might want to check out png2box2d. I don’t know how much documentation there is on it, but I think it might be what you’re looking for. Here’s a blog post on it from someone else’s blog:

http://www.emanueleferonato.com/2013/03/13/from-png-to-box2d-first-attempt/

Hi @punyroboto,

At this time, it’s not possible to change/move individual vertices after creating the shape. For this, you’d need to remove the current shape and re-draw it.

The feature that @Panc mentioned (PngToBox2D) is more specific to physics objects, being that it traces a PNG image (in regards to its transparent pixels) and creates a table of vertices for that object, which you can then use to create a complex physics body. But, I don’t think that’s the functionality you’re looking for in this case.

Best regards,

Brent

Man, I’ve been striking out all over the forums these days!

@panc i need to be more careful in the phrasing of my questions :slight_smile:

thanks Brent

The amazing horacybury created a nice utility for this functionality in the Code Exchange:

http://developer.coronalabs.com/code/body-modification

thanks , this isn’t quite what i mean though

not necessarily changing a physics object, but the shape object itself…

ie . create a polygon or multiline, then fill it with a pattern, then animate the vertices.

for example, to create a lightning bolt i would draw a line and append more verts to it, then on each subsequent frame add random movement to the vertices. 

Hmm… so you aren’t looking to changing the shape after creation, but changing a shape. 

You might want to check out png2box2d. I don’t know how much documentation there is on it, but I think it might be what you’re looking for. Here’s a blog post on it from someone else’s blog:

http://www.emanueleferonato.com/2013/03/13/from-png-to-box2d-first-attempt/

Hi @punyroboto,

At this time, it’s not possible to change/move individual vertices after creating the shape. For this, you’d need to remove the current shape and re-draw it.

The feature that @Panc mentioned (PngToBox2D) is more specific to physics objects, being that it traces a PNG image (in regards to its transparent pixels) and creates a table of vertices for that object, which you can then use to create a complex physics body. But, I don’t think that’s the functionality you’re looking for in this case.

Best regards,

Brent

Man, I’ve been striking out all over the forums these days!

@panc i need to be more careful in the phrasing of my questions :slight_smile:

thanks Brent