How would I print the vertices of an outline?

Hi, I’ve been on Corona for several months now, and this probably has a very simple solution.

 

So I used the graphics.newOutline() function to create a physics body, but I cant use it in my finished product because I dont have the Pro version. I was thinking that maybe I could print the vertices and enter them in manually to my physics body. How would I print them? Here’s a little bit of my code:

 

[lua] p_options =
{
– Required params
width = 135,
height = 150,
numFrames = 2,
– content scaling
sheetContentWidth = 270,
sheetContentHeight = 150,
}

playerSheet = graphics.newImageSheet( “StealthStrikeNinjaSprite.png”, p_options )
–local frameIndex = 2
local playerOutline = graphics.newOutline(2, playerSheet, 1)
print (playerOutline.outline) – Heres where I want to print the vertices of the outline declared above
–playerOutline[/lua]

 

Thanks to anyone who helps!

What do you mean you can’t have it in your finished product because you don’t have pro? 

–SonicX278

Hi @cookiemaster405,

Please see the documentation for “graphics.newOutline()”. This returns the table of vertices, so you should be able to loop through it (or whatever you need to do) and print out the values.

So essentially, “playerOutline” in your example would be the table of vertices:

https://docs.coronalabs.com/api/library/graphics/newOutline.html

Also, as @SonicX278 suggests, there is no “Pro” or “Starter” versions of Corona at this time. There is simply Corona SDK, which was formerly “Pro”, and it’s free for all to use (so, all former “Pro” features are now freely available).

Take care,

Brent

Thanks Brent, but whenever I run the program, it says that I need to upgrade to ‘Pro’ in order to view the game on a device. Why is this? Also, I still don’t understand how to print out all of the vertices, I’ve already read the documentation a few times.

I’m using Corona version 2015.2731 by the way.

Hmm, did you ever do a “Deauthorize and Quit” from the Simulator and log back in? That should give you full access.

Brent

That worked! Thanks Bret. But I’m still curious, how would I go about printing the vertices? Just for future reference, I feel like it’s a simple thing that I should know.

Hi @cookiermaster405,

It should just be a matter of looping through the table and printing out the values, just like any standard Lua table. Are you familiar with how to do that?

Brent

What do you mean you can’t have it in your finished product because you don’t have pro? 

–SonicX278

Hi @cookiemaster405,

Please see the documentation for “graphics.newOutline()”. This returns the table of vertices, so you should be able to loop through it (or whatever you need to do) and print out the values.

So essentially, “playerOutline” in your example would be the table of vertices:

https://docs.coronalabs.com/api/library/graphics/newOutline.html

Also, as @SonicX278 suggests, there is no “Pro” or “Starter” versions of Corona at this time. There is simply Corona SDK, which was formerly “Pro”, and it’s free for all to use (so, all former “Pro” features are now freely available).

Take care,

Brent

Thanks Brent, but whenever I run the program, it says that I need to upgrade to ‘Pro’ in order to view the game on a device. Why is this? Also, I still don’t understand how to print out all of the vertices, I’ve already read the documentation a few times.

I’m using Corona version 2015.2731 by the way.

Hmm, did you ever do a “Deauthorize and Quit” from the Simulator and log back in? That should give you full access.

Brent

That worked! Thanks Bret. But I’m still curious, how would I go about printing the vertices? Just for future reference, I feel like it’s a simple thing that I should know.

Hi @cookiermaster405,

It should just be a matter of looping through the table and printing out the values, just like any standard Lua table. Are you familiar with how to do that?

Brent