mygui與luaplus的繫結

2021-05-23 14:21:31 字數 631 閱讀 5322

1.cegui裡load layout的時候,有關於event的property項,內容乙個是event名,另乙個是lua指令碼裡的function name.  event事件來後fireevent,依次呼叫event裡的slotcontainer函式指標容器內的subscriberslot,而lua對應的應該是scriptfunctor模板轉換的functorcopyslot,scriptfunctor過載了operator(),operator()呼叫的就是scriptmodule裡的executescriptedeventhandler,

scriptmodule可以是luaplus也可以是tolua++

2.mygui如何實現類似的功能,與cegui不同,cegui所有window都繼承於eventset,由乙個事件名稱去索引出event,mygui用的是delegate, 暫時的想法是load layout的時候因為沒有event的property項,所以只能用userstring項代替了,還好新版的支援eventadduserstring的delegate,讀到自定義特定的userstirng事件時,將delegate加到自己的乙個luamgr類似的類函式上,同時將一些delegate回傳回來的引數轉到lua裡

xml:

lua:

c++:

mygui 與 sdktray 的比較

mygui是個很好很強大的gui系統.那這個系統與sdktray比較,哪個更有優勢呢?1 從實現來看,sdktray基於ogre的overlay和material系統 而mygui則完全基於頂點等非常底層的東西.在mygui的ogreplatform標頭檔案的檔名可以看見,mygui是基於頂點和紋理...

luaplus 與官方文件慢慢扯 一

此人文筆很爛 將就看吧 luastate 是 c 版本的 lua state 大多數 lua的普通c函式 都基礎在 luastate內 兩者效率相差不大 建立 luastate 例項 luastate create 靜態函式用於建立乙個 luastate 例項 此函式有乙個可選引數 如果為true ...

LuaPlus的編譯和引用

編譯luaplus 首先從這個位址檢出luaplus最新版本的原始碼 svn svn.luaplus.org luaplus work51 src luaplus 然後雙擊裡面的 luapluslib.vs2005.vcproj,用vs2008開啟後按提示轉換。進行一次編譯,將會提示許多類似 lap...