Lua Glider for Corona® v 1.7 Released! -Discounts Included

Hello Hendrix,

Currently there is not a feature like this. It is planned however, and there will be many lua specific code generators in the future. Please be aware that the autocomplete works inside strings to give you a list of your files in your project folder, you might find it useful:

http://view.xscreenshot.com/c9ea6ddb725f3fcf38afe58d30871588

Regards,

M.Y. Developers

Ok, thanx for letting me know

Snippets are no.1 on the wishlist

Hello Hendrix,

Thanks for the feature request. Can we ask what kind of items do you have on your snippets list? Perhaps it might be better in terms of maintainability/ code duplication to make a utils.lua file? Please be aware that the code completion works on even your own libraries so you can dump all your snippets into a utils.lua file and just require “utils” like you would any library. You can then invoke autocomplete on it and get a list of your commonly used functions. Even better you should put this utils in an external library and share it with all your projects. Plus if you find a bug in one of your snippets or for whatever reason you need to change it (ie Corona API changes) then you will have to find every place the snippet is used, which can be quite a hassle. However if you have it in a utils.lua file then you can just change one line and all your projects benefit from the change. 

We aren’t saying snippets are a bad idea, but we want to get a feel for what you use it for and what ways we can help you improve your workflow. We will be implementing some interesting code generators soon such as

  • For loop generators- ipairs, pairs, i indexed flavors, etc 
  • localize variables generators - pick from visible globals and automatically localize them
  • introduce method- intelligently refactor convert a chunk of code into a method

Another point you might want to consider is IDE/vendor lock-in. Since there is no universal file format to store code snippets chances are it will only work for one IDE. However, a lua utilities file is universal, you will only need to write it once.

Please let us know.

Regards,

M.Y. Developers

So, like the snippet like:

(imagefile called: " happyDog.png") I right click on the image and choose newImageRectSnippet (that I made)

generates:

local  happyDog = display.newImageRect( " happyDog.png", 0, 0 )

happyDog.x = xPos

happyDog.y = yPos

happyDog :setReferencePoint( display.CenterReferencePoint )

Is there a easy way to do this with i.e. a rightClick and a util class?

I never done things in C for implementing OSX GUI stuff with mouse clicks and copy to memory and stuff

Hope Im not way out here :slight_smile:

Maybe I could use the record function in some way (never tested that function neither)

Hello Hendrix,

Sure, here is a way:

--imageUtils.lua local imageUtils = {} function imageUtils.createCenteredIR(name, xPos, yPos) local img = display.newImageRect( name..".png", 0, 0 ) img.x = xPos img.y = yPos img:setReferencePoint( display.CenterReferencePoint ) return img end return imageUtils --main.lua local imageUtils = require "imageUtils" local happyDog = imageUtils.createCenteredIR("happyDog", xPos, yPos) local happyDog2 = imageUtils.createCenteredIR("happyDog2", xPos, yPos) local unhappyDog = imageUtils.createCenteredIR("unhappyDog", xPos, yPos)

Is there a easy way to do this with i.e. a rightClick and a util class?

Here is the way we recommend (btw the shortcut for autocomplete is ctrl-space)

Step 1: require your image Utils library (you only need to do this once per file):

http://view.xscreenshot.com/b3e0f61936ad6a36a1644eb0d4bee262

Step 2: invoke autocomplete after imageUtils.

http://view.xscreenshot.com/f0cf8b291085268c2feb6626f74bbf75

Step 3: invoke autocomplete inside quotes:

http://view.xscreenshot.com/8f9a0053a996406b13f55df5e9c5c592

You will have much less code duplication and produce much more shorter, readable, maintainable, and testable code this way. 

Regards,

M.Y. Developers

I have one of those I use in other projects but I didn’t think of the invoke autocomplete stuff (thanx) Its nearly the same and it totally compensate with all the other “good-stuff” :slight_smile:

Is there anything that will be unlocked after I purchase?

I am now a happy owner… :slight_smile:

Thanks again for fast support

Hello Hendrix,

No problem. Thanks for your support!  Please let us know if you come across any issues.

Regards,

M.Y. Developers

In Cider I beleive you rightclicked and got the option to use code snippets

where is that function now?

Is it templates part in the prefs?

Hello Hendrix,

Yes, please see the screenshot below:

http://view.xscreenshot.com/35dc3bd4d1f8ed8cfe99a5fa6d8ad490

Regards,

M.Y. Developers

yes, but how do I access these templates when I code?

Like in CPM Im used to make my own snippets like i.e. I have an image called myImage.png

then I just right click on the file and choose one of my snippets

Heres how Im used to do it in CPM

http://coronaprojectmanager.com/wp-content/uploads/2012/05/parts-snippets-1.jpg

Hello Hendrix,

Currently there is not a feature like this. It is planned however, and there will be many lua specific code generators in the future. Please be aware that the autocomplete works inside strings to give you a list of your files in your project folder, you might find it useful:

http://view.xscreenshot.com/c9ea6ddb725f3fcf38afe58d30871588

Regards,

M.Y. Developers

Ok, thanx for letting me know

Snippets are no.1 on the wishlist

Hello Hendrix,

Thanks for the feature request. Can we ask what kind of items do you have on your snippets list? Perhaps it might be better in terms of maintainability/ code duplication to make a utils.lua file? Please be aware that the code completion works on even your own libraries so you can dump all your snippets into a utils.lua file and just require “utils” like you would any library. You can then invoke autocomplete on it and get a list of your commonly used functions. Even better you should put this utils in an external library and share it with all your projects. Plus if you find a bug in one of your snippets or for whatever reason you need to change it (ie Corona API changes) then you will have to find every place the snippet is used, which can be quite a hassle. However if you have it in a utils.lua file then you can just change one line and all your projects benefit from the change. 

We aren’t saying snippets are a bad idea, but we want to get a feel for what you use it for and what ways we can help you improve your workflow. We will be implementing some interesting code generators soon such as

  • For loop generators- ipairs, pairs, i indexed flavors, etc 
  • localize variables generators - pick from visible globals and automatically localize them
  • introduce method- intelligently refactor convert a chunk of code into a method

Another point you might want to consider is IDE/vendor lock-in. Since there is no universal file format to store code snippets chances are it will only work for one IDE. However, a lua utilities file is universal, you will only need to write it once.

Please let us know.

Regards,

M.Y. Developers

So, like the snippet like:

(imagefile called: " happyDog.png") I right click on the image and choose newImageRectSnippet (that I made)

generates:

local  happyDog = display.newImageRect( " happyDog.png", 0, 0 )

happyDog.x = xPos

happyDog.y = yPos

happyDog :setReferencePoint( display.CenterReferencePoint )

Is there a easy way to do this with i.e. a rightClick and a util class?

I never done things in C for implementing OSX GUI stuff with mouse clicks and copy to memory and stuff

Hope Im not way out here :slight_smile:

Maybe I could use the record function in some way (never tested that function neither)

Hello Hendrix,

Sure, here is a way:

--imageUtils.lua local imageUtils = {} function imageUtils.createCenteredIR(name, xPos, yPos) local img = display.newImageRect( name..".png", 0, 0 ) img.x = xPos img.y = yPos img:setReferencePoint( display.CenterReferencePoint ) return img end return imageUtils --main.lua local imageUtils = require "imageUtils" local happyDog = imageUtils.createCenteredIR("happyDog", xPos, yPos) local happyDog2 = imageUtils.createCenteredIR("happyDog2", xPos, yPos) local unhappyDog = imageUtils.createCenteredIR("unhappyDog", xPos, yPos)

Is there a easy way to do this with i.e. a rightClick and a util class?

Here is the way we recommend (btw the shortcut for autocomplete is ctrl-space)

Step 1: require your image Utils library (you only need to do this once per file):

http://view.xscreenshot.com/b3e0f61936ad6a36a1644eb0d4bee262

Step 2: invoke autocomplete after imageUtils.

http://view.xscreenshot.com/f0cf8b291085268c2feb6626f74bbf75

Step 3: invoke autocomplete inside quotes:

http://view.xscreenshot.com/8f9a0053a996406b13f55df5e9c5c592

You will have much less code duplication and produce much more shorter, readable, maintainable, and testable code this way. 

Regards,

M.Y. Developers

I have one of those I use in other projects but I didn’t think of the invoke autocomplete stuff (thanx) Its nearly the same and it totally compensate with all the other “good-stuff” :slight_smile:

Is there anything that will be unlocked after I purchase?

I am now a happy owner… :slight_smile:

Thanks again for fast support

Hello Hendrix,

No problem. Thanks for your support!  Please let us know if you come across any issues.

Regards,

M.Y. Developers

In Nov 2012 in this thread, someone asked: 

How can we change the color of the ‘filenames’ appeared on the Editor Window’s tabs, or in the Projects/Files Window?

I chose the BlackEye theme and the filenames’ are colored blue in default, making it very difficult to tell. 

I didn’t see a solution in here and can’t seem to find a way to change those colors.  The BlackEye theme is really the only one that works for me, but it’s hard when you can’t read the names of the files in the tabs.  They start out white but then turn gray or black after you edit them.  I’ve looked all through the Preferences and can’t find a way to change these colors but am probably just missing it. Can you please point me in the right direction?