Hi John,
Correct me if I am wrong, but in your code below you are using the functions that make up the
display table:
Code: Select all
display.captureScreen ( <#saveToAlbumBool#> )
display.contentCenterX
Why this is not working is because nowhere in your code is there a definition of the
display table.
Without somesort of definition, there is no ctags information, hence Zeus knows nothing about the object and as such it can't show any of it's functions.
But luckily there is quite an easy to fix this
Can you try doing the following:
- I am assuming you are running Windows XP (see below if this is not the case)
- Create a new workspace called Lua in the following folder location.
- Remove the Header and Resource folders.
- Add this file (which should already exist) to the Source folder of that workspace:
Code: Select all
c:\Program Files\Zeus\zTags\Templates\Lua.js
- Append this code to the end of that file:
Code: Select all
// Created using http://developer.anscamobile.com/reference/display-objects
class display
{
// Common Methods
remove();
// Content Size Properties
contentCenterX;
contentCenterY;
contentHeight;
contentScaleX;
contentScaleY;
contentWidth;
screenOriginX;
screenOriginY;
statusBarHeight;
viewableContentHeight;
viewableContentWidth;
//Factory Functions
loadRemoteImage( );
newCircle();
newEmbossedText();
newGroup();
newImage( );
newImageRect();
newLine( );
newRect();
newRetinaText();
newRoundedRect();
newText();
//Other Display Functions
captureScreen( );
save( );
setDefault( );
setStatusBar( );
//Stage Display Objects
getCurrentStage( );
}
Now if you create a new Lua file and type in this code:
-
You should get the correct intellisense as expected.
If you are running on Windows 7 then the location of these files will be different.
To find the corrent location just use the
Macro, Load menu and in the resulting dialog move up one folder level to help the correct
zTags folder location.
So how does this all work
Well the steps above do nothing more than create a very simple definition of the
display object.
This
display object definition has also been saved to the Lua tag database that is attached to this Lua workspace.
Also the default definition of the
Lua document type has been pre-defined to use this Lua tag database.
So this means any time you edit any Lua file, Zeus will go looking into this tag database for any object definitions.
But you will notice one final trick
The object definition has been put into a Java Script file and not an Lua file.
This has to be done because the
ctag.exe does not fullly support modern day Lua code.
But since we only require a
very simple skeleton of the object definition we can get away with just a little bit of Java Script to provide the definition
Cheers Jussi