资源简介
http://blog.csdn.net/ljxfblog 自写richtext博文配套代码。

代码片段和文件信息
#include “cocos2d.h“
#include “tolua_fix.h“
#include “CCLuaValue.h“
#include “CCLuaEngine.h“
#include “RichItem.h“
#include “RichTextUI.h“
#include “LuaBasicConversions.h“
#include “LuascriptHandlerMgr.h“
USING_NS_CC;
using namespace ui;
int register_extend_cocos2dx_ui_manual(lua_State* L);
struct LuaStudioEventListenerDataEx
{
Ref* objTarget;
int eventType;
LuaStudioEventListenerDataEx(Ref* _objTarget int _eventType) : objTarget(_objTarget)eventType(_eventType){}
};
class LuaCocoStudioEventListenerEx : public Ref
{
public:
LuaCocoStudioEventListenerEx(){}
virtual ~LuaCocoStudioEventListenerEx(){}
static LuaCocoStudioEventListenerEx* create();
virtual void eventCallbackFunc(Ref* senderint eventType);
};
LuaCocoStudioEventListenerEx* LuaCocoStudioEventListenerEx::create()
{
LuaCocoStudioEventListenerEx* listener = new LuaCocoStudioEventListenerEx();
if (nullptr == listener)
return nullptr;
listener->autorelease();
return listener;
}
void LuaCocoStudioEventListenerEx::eventCallbackFunc(Ref* senderint eventType)
{
int handler = scriptHandlerMgr::getInstance()->getobjectHandler((void*)this scriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);
if (0 != handler)
{
LuaStudioEventListenerDataEx eventData(sender eventType);
BasicscriptData data(this (void*)&eventData);
LuaEngine::getInstance()->handleEvent(scriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER (void*)&data);
}
}
static int lua_cocos2dx_RichTextUI_addEventListenerRichTextUI(lua_State* L)
{
if (nullptr == L)
return 0;
int argc = 0;
RichTextUI* self = nullptr;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_isusertype(L1“ui::RichTextUI“0&tolua_err)) goto tolua_lerror;
#endif
self = static_cast(tolua_tousertype(L10));
#if COCOS2D_DEBUG >= 1
if (nullptr == self) {
tolua_error(L“invalid ‘self‘ in function ‘lua_cocos2dx_RichTextUI_addEventListenerRichTextUI‘\n“ NULL);
return 0;
}
#endif
argc = lua_gettop(L) - 1;
if (1 == argc)
{
#if COCOS2D_DEBUG >= 1
if (!toluafix_isfunction(L2“LUA_FUNCTION“0&tolua_err))
{
goto tolua_lerror;
}
#endif
LuaCocoStudioEventListenerEx* listener = LuaCocoStudioEventListenerEx::create();
if (nullptr == listener)
{
tolua_error(L“LuaCocoStudioEventListenerEx create fail\n“ NULL);
return 0;
}
LUA_FUNCTION handler = ( toluafix_ref_function(L20));
scriptHandlerMgr::getInstance()->addobjectHandler((void*)listener handler scriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);
__Dictionary* dict = static_cast<__Dictionary*>(self->getUserobject());
if (nullptr == dict)
{
dict = Dictionary::create();
self->setUserobject(dict);
}
dict->setobject(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4870 2014-05-17 01:15 richedit\RichItem.cpp
文件 3616 2014-05-17 01:09 richedit\RichItem.h
文件 8100 2014-05-18 00:29 richedit\RichTextUI.cpp
文件 2006 2014-05-18 00:18 richedit\RichTextUI.h
文件 1219 2014-05-18 00:19 richedit\gui.pkg
文件 3911 2014-05-17 01:24 richedit\lua_cocos2dx_extend_ui.cpp
目录 0 2014-05-18 11:32 richedit\
- 上一篇:计算机编译原理第三版张幸儿课后答案
- 下一篇:mit.tar.gz
相关资源
- 通信软件的具体实例──基于Socket的
- 用VC 编写的仿QQ聊天室程序源代码
- Qt局域网聊天软件
- websocket实现一对一聊天
- QT局域网聊天系统(基于QT5.修改过)
- 基于swing的简单聊天器(兼传输文件)
- 飞秋FeiQ 兼容qq和飞鸽传书功能
- 基于CSocket的多人聊天室
- mfc聊天室
- irc聊天室
- Scratch案例:聊天交互 .sb2
- 微信聊天机器人源码
- Axure原型(IM聊天工具PC端).rp
- swift-模仿类似聊天的UI
- 易语言服务器源码易语言简易聊天室
- 易语言P2P聊天源码
- 嵌入式局域网聊天系统客户端
- QQ米i吗破解
- 漫言阁个人博客 V3.0 全功能版
- GG2014版源码。仿QQ聊天软件
- SignalR net版本的在线聊天室
- linux网络聊天室
- 基于ajax的web聊天室
- FLASH局域网免服务器P2P聊天室源码(
- 易语言客户端源码易语言服务端源码
- 易语言易聊天客户端源码易语言易聊
- 易语言聊天室客户源码易语言聊天室
- .net 实现 简单的QQ聊天
- 利用同步TCP编写网络聊天程序
- 微信机器人 v3.5绿色免费版.zip
评论
共有 条评论