- 博客(8)
- 资源 (5)
- 收藏
- 关注
原创 使用C++委托实现全方向的摇杆
1.摇杆类//// Rocker.hpp// Rocker//// Created by Forest on 16/7/11.////#ifndef Rocker_hpp#define Rocker_hpp#include <stdio.h>#include "cocos2d.h"USING_NS_CC;class Rocker;class RockerDelegate{pu
2016-07-28 21:24:26 1598 1
原创 利用C++11新特性重构自定义Button
使用C++11一些新特性将上篇的自定义Button重构//// CustomButton.h// CustomButton//// Created by Forest on 16/5/6.////#ifndef __CustomButton__CustomButton__#define __CustomButton__CustomButton__#include <stdio.h
2016-07-27 21:33:35 1025
原创 用C++函数指针封装自定义的Button
自定义Button类://// CustomButton.h// fun_point_button//// Created by Forest on 16/4/28.////#ifndef __fun_point_button__CustomButton__#define __fun_point_button__CustomButton__#include <stdio.h>#
2016-07-26 22:08:20 1292
转载 在C/C++项目中接入LuaSQLite3
首先需要 这3个文件,lsqlite3.c下载地址: 这里写链接内容 sqlite3.c和sqlite3.h下载地址: 这里写链接内容将这3个文件导入到项目中,并增加一个头文件lsqlite3.h, //// lsqlite3.h// LuaAndCpp//#ifndef lsqlite3_h#define lsqlite3_hint luaopen_lsqlite3(lu
2016-07-25 21:43:02 675
转载 编写C模块供Lua使用
在Lua的源码linit.c中增加如下代码static int showRlt1(lua_State* L);static int showRlt2(lua_State* L); // 另一种注册方式 static const luaL_Reg mylibs[] = { {"showRlt1",showRlt1}, {"showRlt2",showRl
2016-07-21 21:33:03 789
转载 Lua调用C/C++函数
//// main.cpp// LuaAndCpp//#include <iostream>static int lua_getName(lua_State* L){ lua_pushstring(L, "string from c"); std::cout << "lua call c function \n" ; return 1;}static int showO
2016-07-18 21:00:23 502
转载 C/C++遍历Lua中的table
config.luatest_table = { name = 'app', age = 13}//// LuaEngine.h// LuaAndCpp//#ifndef __LuaAndCpp__LuaEngine__#define __LuaAndCpp__LuaEngine__#include <stdio.h>#include <iostream>#incl
2016-07-11 19:59:33 2066
转载 C/C++读取Lua中的变量及调用Lua函数
config.luaprint('--In Lua--')local a = -10print('--math.abs(a)--',math.abs(a))width = 1080height = 720name = "iphone"numStr = 12345function test1() print('--function test1--')endfunction test2(
2016-07-06 18:16:05 5572
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人