graphics.newOutline() sdk crash

Hi
When I try the example from the api reference, sdk crashes, saying if it is a function I may have used : Instead of.

Im loading the physics engine correctly, everything else works perfect. I tried everything, also different machines (win 7 & 8). Heres the example:
local image_name = “star.png”

local image_outline = graphics.newOutline( 2, image_name )

local image_star = display.newImageRect( image_name )

physics.addBody( image_star, { outline=image_outline } )

Thanks for your help,
Olivier

Hi @Olivier,

It looks like you’re missing the width and height parameters for “display.newImageRect()”. That API requires those properties. For example:

[lua]

local image_star = display.newImageRect( image_name, 32, 32 )

[/lua]

Best regards,

Brent

Here’s the documentation for reference:

http://docs.coronalabs.com/api/library/display/newImageRect.html

Thanks very much! It runs now. Can you correct the example in the api?

Thanks!!

Olivier

Hi Olivier,

The example in the documentation is correct, showing the width (70) and height (41) of the image sheet frame.

[lua]

local obj = display.newImageRect( imageSheet, 1, 70, 41 )

[/lua]

Is there some other mistake that you see?

Thanks,

Brent

look here, the last example:

http://docs.coronalabs.com/api/library/physics/addBody.html

Regards

Olivier

Hi Olivier,

Oops, you’re right, thanks for noticing that. I’ll fix it soon.

Brent

Hi @Olivier,

It looks like you’re missing the width and height parameters for “display.newImageRect()”. That API requires those properties. For example:

[lua]

local image_star = display.newImageRect( image_name, 32, 32 )

[/lua]

Best regards,

Brent

Here’s the documentation for reference:

http://docs.coronalabs.com/api/library/display/newImageRect.html

Thanks very much! It runs now. Can you correct the example in the api?

Thanks!!

Olivier

Hi Olivier,

The example in the documentation is correct, showing the width (70) and height (41) of the image sheet frame.

[lua]

local obj = display.newImageRect( imageSheet, 1, 70, 41 )

[/lua]

Is there some other mistake that you see?

Thanks,

Brent

look here, the last example:

http://docs.coronalabs.com/api/library/physics/addBody.html

Regards

Olivier

Hi Olivier,

Oops, you’re right, thanks for noticing that. I’ll fix it soon.

Brent