change object properties?

Hi All,

i am define a newCircle like:  (a = display.newCircle(-100, -60, 20))

and i want change to circle radius 20 to 30 later.

is it possible?

You can’t change the radius property - it’s read only. I believe the only way to do this is to remove the circle and recerate it with the new radius.

You can, however, change the xScale and yScale later:

myCircle.xScale = 2.0

myCircle.yScale = 2.0

Note that an xScale/yScale of 1.0 is the current size of the circle. 

thsnk you guys.

also cant i change the image object’s picture??

Nope, you cannot. Once xcreared display object cannot have it’s texture changed.

Hi @gurcanhamali0,

For this, you’d need to configure the image as a “sprite” and then change the frame. It’s not too much different from setting up a normal image, except that you need to create the image sheet, declare the sequence, and then create the object as a newSprite() versus a newImage() or newImageRect().

http://docs.coronalabs.com/guide/media/imageSheets/index.html

http://www.coronalabs.com/blog/2012/10/02/animated-sprites-and-methods/

Best regards,

Brent

thank  you for information Brent Sorrentino  :slight_smile:

You can’t change the radius property - it’s read only. I believe the only way to do this is to remove the circle and recerate it with the new radius.

You can, however, change the xScale and yScale later:

myCircle.xScale = 2.0

myCircle.yScale = 2.0

Note that an xScale/yScale of 1.0 is the current size of the circle. 

thsnk you guys.

also cant i change the image object’s picture??

Nope, you cannot. Once xcreared display object cannot have it’s texture changed.

Hi @gurcanhamali0,

For this, you’d need to configure the image as a “sprite” and then change the frame. It’s not too much different from setting up a normal image, except that you need to create the image sheet, declare the sequence, and then create the object as a newSprite() versus a newImage() or newImageRect().

http://docs.coronalabs.com/guide/media/imageSheets/index.html

http://www.coronalabs.com/blog/2012/10/02/animated-sprites-and-methods/

Best regards,

Brent

thank  you for information Brent Sorrentino  :slight_smile: