I’m using SciTE to write my lua code, there is no api reference, i wonder if there is already some api files so that the editor could have autocompletion for cocos2dx, just like it does for the standard lib of lua. Has anyone written an api file already?
Primitive ref:
run cocodoc.lua pathToLuaCocos2d.cpp > anHtmlFile
ex:
cocodoc.lua “e:2d-x\scripting\lua\cocos2dx_support\LuaCocos2d.cpp” > cocodoc.html
open cocodoc.html in a browser
it is not very fancy and should be enhanced
Andre
Andre Arpin wrote:
Primitive ref:
>
run cocodoc.lua pathToLuaCocos2d.cpp > anHtmlFile
>
ex:
cocodoc.lua “e:cocos2d-xscriptingluacocos2dx_supportLuaCocos2d.cpp” > cocodoc.html
>
open cocodoc.html in a browser
>
it is not very fancy and should be enhanced
>
Andre
thx for your reply. but it reported:
d:51\lua.exe: C:.lua:1: module ‘dump’ not found:
no field package.preload[‘dump’]
no file ‘…lua’
no file ‘d:51\lua\dump.lua’
no file ‘d:51\lua\dump\init.lua’
no file ‘d:51\dump.lua’
no file ‘d:51\dump\init.lua’
no file ‘d:51\lua\dump.luac’
no file ‘…dll’
no file ‘.51.dll’
no file ‘d:51\dump.dll’
no file ‘d:51\dump51.dll’
no file ‘d:51\clibs\dump.dll’
no file ‘d:51\clibs\dump51.dll’
no file ‘d:51\loadall.dll’
no file ‘d:51\clibs\loadall.dll’
stack traceback:
[C]: in function ‘require’
C:.lua:1: in main chunk
[C]: ?
how to fix that?
Just take out the require dump
or use this file.
The html is very minimal I will look into making this nicer when I have some time.
This allow you to find all the classes, functions and constant supported by Lua.
The file is extensively cross link. Used in combination with the Doxygen documentation it is a very decent reference.
Andre
Please use the second file
This is the last version.
Generates
A list of the class names (in alphabetic order) link to the actual class.
for each class
#
First an inheritance tree.
#
A table for the class containing:
*
the functions, with a list of the argument and type.
*
the variables
*
the constants
Andre
cocodoc.lua pathToLuaCocos2d.cpp > anHtmlFile
ex:
cocodoc.lua "e:cocos2d-xscriptingluacocos2dx_supportLuaCocos2d.cpp" > cocodoc.html
cocodoc.html
I get an assert exception in line 70
This is odd it means that I did not find the definition for a function.
I am wondering if your file contains tabs I did not account for tabs.
Try the included version see if it works added a line that replaces tabs by spaces.
If it fail comment the assert and see if it otherwise works.
If no joy could you post your LuaCocos2d.cpp.
Sorry about that.
Andre
It only works when I delete the assert line 70.
Now I get this doc HTML file.
Is this looking ok?
Extract cocos2d-2.0-x-2.0.2.zip to e:extract tolua**.exe from tolua**.rar
cd “cocoorg\tools\tolua++”
run: ant
run: cocodoc.lua e:2dx_support\LuaCocos2d.cpp > cocodoc.html
are you using the same version ?coco
using lua 5.1.5
Andre
Just to pitch in on this, i usually just read the .pkg files to find out what functions are available.
So for example to find out about functions in CCNode i read tools/tolua++/CCNode.pkg