Native Library and buttons

I’ve been watching these J.A Whye tuts on YouTube and he accesses a Native Library of widget buttons.

Are these not accessible using the Starter SDK?

I saw that the Corona Pricing webpage showed Native APIs/Libraries as not part of “Basic” and I wasn’t sure if this is an example of a “Native Library.”

Thanks for helping a newb!

Hi @rshanlon,

Corona’s collection of widgets is available to all tiers:

http://docs.coronalabs.com/api/library/widget/index.html

As for “native”, that’s sort of a broad term. Corona offers hooks into various “native” functionality on devices, like web views, keyboard input, maps, etc.

http://docs.coronalabs.com/api/library/native/index.html

But as for true native-to-Corona (and vice-versa), some of that would require Corona Enterprise or CoronaCards.

Hope that clarifies it,

Brent

Interesting, Brent.  There’s a part in his video where he requires the Widget Library at the top and then lower down the page, he makes a function called doButton

The video here at the 1:47 mark http://www.youtube.com/watch?v=wF3XYCBPgVk&list=PLtNErhYMkHnHuIZ885KpdZTkAsiBEiJaR )

He makes just under the doButton function 

local optButton = widget.newButton { label=“Set Options” }

He goes back to the Simulator and suddenly there’s a grey button image with “Set Options” typed on it. 

I’m thinking to myself that there must be some kind of internal widget library that has pre-made button images he accessed.  He has a folder of “images” but nowhere in the code did he reference an image file other than a background image file.

I ask, because I did the same thing he did and I got my Background image to appear but no grey button (and I required the widget library at the start of my code, too).  That made me think, maybe the Starter account doesn’t have access to these button images that just appeared by magic in his demo.

Hmmm.  A little puzzled where that grey button came from.    Are you able to instantly call a button image, too, using that simple code?

That video is a little dated I think. Version 1 of the widgets library provided buttons with backgrounds such as the one you see in the video. Version 2 of the widgets library (current version) sadly dropped this feature with no warning. Currently the buttons can only have a background if you supply it in the form of an image file yourself. See button API documentation for more details : https://docs.coronalabs.com/api/library/widget/newButton.html

Thanks, ksan.  

Just wanted to make sure I wasn’t missing something since I knew the code I was copying was like his code but wasn’t getting the same results.

You’re most welcome. J.A Whye makes some great tutorials. You can probably see his most up to date videos as his site : masteringcoronasdk.com

You can see the latest widget button tutorial video here (part of a paid course, but those vids are free):

http://masteringcoronasdk.com/biz-app-course-v2-widgets/the-button-widget/

If you want to use the “external” version of the widget library, also see this part of the course:

http://masteringcoronasdk.com/biz-app-course-v2-widgets/installing-the-v2-widget-library/

 Jay

Jay’s tutorials are a great way to get up to speed in building business apps. Wholeheartedly recommended!!!

Thanks both of you for the links.  Off to see those.

Jay, you’ve got a nice sounding voice and clear vocal delivery.  Believe it or not, that can really make or break a tut video.  

Thanks, rshanlon. To be honest, there’s a big difference between the Infinite Skills videos and the ones I produce. The IS editors are *hard-core* at their job and make me sound like a freakin’ pro!

Me, I edit out the worst of the flubs and just go with the flow for the rest. :wink:

 Jay

When I code this at the top as the new pointer to the widgets lib:

local widget = require(“widgetLibrary.widget”)

I get a blank Sim screen or I get “Attempt to index field ‘colours’ (a nil value)”

As soon I remove widgetLibrary and it just reads  

local widget = require(“widget”)

then everything shows up on the Sim screen but without the snazzy widget art that’s included in this library.

The corona widgetLibrary (gotten from github) is placed in the directory folder.

Am I doing something wrong in order to get the snazzy art to show for these widgets? (Same behavior for segmented control/pickerwheel/Table Widget)

Hi @rshanlon,

Corona’s collection of widgets is available to all tiers:

http://docs.coronalabs.com/api/library/widget/index.html

As for “native”, that’s sort of a broad term. Corona offers hooks into various “native” functionality on devices, like web views, keyboard input, maps, etc.

http://docs.coronalabs.com/api/library/native/index.html

But as for true native-to-Corona (and vice-versa), some of that would require Corona Enterprise or CoronaCards.

Hope that clarifies it,

Brent

Interesting, Brent.  There’s a part in his video where he requires the Widget Library at the top and then lower down the page, he makes a function called doButton

The video here at the 1:47 mark http://www.youtube.com/watch?v=wF3XYCBPgVk&list=PLtNErhYMkHnHuIZ885KpdZTkAsiBEiJaR )

He makes just under the doButton function 

local optButton = widget.newButton { label=“Set Options” }

He goes back to the Simulator and suddenly there’s a grey button image with “Set Options” typed on it. 

I’m thinking to myself that there must be some kind of internal widget library that has pre-made button images he accessed.  He has a folder of “images” but nowhere in the code did he reference an image file other than a background image file.

I ask, because I did the same thing he did and I got my Background image to appear but no grey button (and I required the widget library at the start of my code, too).  That made me think, maybe the Starter account doesn’t have access to these button images that just appeared by magic in his demo.

Hmmm.  A little puzzled where that grey button came from.    Are you able to instantly call a button image, too, using that simple code?

That video is a little dated I think. Version 1 of the widgets library provided buttons with backgrounds such as the one you see in the video. Version 2 of the widgets library (current version) sadly dropped this feature with no warning. Currently the buttons can only have a background if you supply it in the form of an image file yourself. See button API documentation for more details : https://docs.coronalabs.com/api/library/widget/newButton.html

Thanks, ksan.  

Just wanted to make sure I wasn’t missing something since I knew the code I was copying was like his code but wasn’t getting the same results.

You’re most welcome. J.A Whye makes some great tutorials. You can probably see his most up to date videos as his site : masteringcoronasdk.com

You can see the latest widget button tutorial video here (part of a paid course, but those vids are free):

http://masteringcoronasdk.com/biz-app-course-v2-widgets/the-button-widget/

If you want to use the “external” version of the widget library, also see this part of the course:

http://masteringcoronasdk.com/biz-app-course-v2-widgets/installing-the-v2-widget-library/

 Jay

Jay’s tutorials are a great way to get up to speed in building business apps. Wholeheartedly recommended!!!

Thanks both of you for the links.  Off to see those.

Jay, you’ve got a nice sounding voice and clear vocal delivery.  Believe it or not, that can really make or break a tut video.  

Thanks, rshanlon. To be honest, there’s a big difference between the Infinite Skills videos and the ones I produce. The IS editors are *hard-core* at their job and make me sound like a freakin’ pro!

Me, I edit out the worst of the flubs and just go with the flow for the rest. :wink:

 Jay