help with using libraries (mac)

just tried to add the director class as a library to a very minimal test project

first I added the director class via the preferences option in cpm


director.lua Macintosh HD:Users:macuser:Documents:work:corona development:libraries:director_by_ricardo_rauber_1_4:director.lua

i then created a new project and set it to use a base folder called "test" on the desktop

i then went to tools - code generator and ticked the checkbox next to director.lua and copied the following code to clipboard

1
2
3
-- cpmgen main.lua
 
local director = require("director")

solved this one - i realise I need to add the director.lua file to my assets

in this case I am not really grasping the benefits of adding the library files - is it simply to ease adding the require line of code in the code generator?

In the next major version of CPM the libraries feature will get an overhaul or go away -- I haven't decided yet.

If you have a file in Libraries and check that box in the Code Generator, it should add the require() line and copy a link to that asset into your new project.

Saves a couple steps, but not really as earth-shattering as I'd like it to be. :)

Jay

thanks for the reply. Just to clarify: you said

If you have a file in Libraries and check that box in the Code Generator, it should add the require() line and copy a link to that asset into your new project.

It didn't appear to copy a link to that asset into my project - I had to add the asset using the add asset button

thanks for the reply. Just to clarify: you said

If you have a file in Libraries and check that box in the Code Generator, it should add the require() line and copy a link to that asset into your new project.

It didn't appear to copy a link to that asset into my project - I had to add the asset using the add asset button

thanks for the reply. Just to clarify: you said

If you have a file in Libraries and check that box in the Code Generator, it should add the require() line and copy a link to that asset into your new project.

It didn't appear to copy a link to that asset into my project - I had to add the asset using the add asset button

thanks for the reply. Just to clarify: you said

If you have a file in Libraries and check that box in the Code Generator, it should add the require() line and copy a link to that asset into your new project.

It didn't appear to copy a link to that asset into my project - I had to add the asset using the add asset button

Hmm seems to have duplicated my reply. Posting from ipad2

It is *supposed* to copy the chosen library into the project -- I'll take a look at that.

Also, instead of using Add New Asset to pull in something like Director, if you keep all your "library-type" files in a project, you can switch to that and drag and drop the wanted libraries to your new project folder. A little faster than going through the menu+open dialog.

Jay

views:1380 update:2011/10/11 22:13:38
corona forums © 2003-2011