Cocos2d-x3.2下Lua,UserDefault、Texture的使用
来源:互联网 发布:天眼查数据来源 编辑:程序博客网 时间:2024/05/16 09:26
原文地址:http://blog.csdn.net/qqmcy/article/details/37962013
//// // //// Created by 杜甲 on 14-7-16.////require "Cocos2d" function Shaky3DDemo(t) return cc.Shaky3D:create(t,cc.size(15,10),5,false)endlocal Sprite1 = {}Sprite1.__index = Sprite1setmetatable(Sprite1,cc.Sprite)local mLayer = {}mLayer.__index = mLayerfunction mLayer.initlayer() pLayer = cc.Layer:create() local sprite = cc.Sprite:create("res/dog.png") sprite:setPosition(300,200) pLayer:addChild(sprite) --赋值 cc.UserDefault:getInstance():setStringForKey("name","xiaonan") --取值 local ret = cc.UserDefault:getInstance():getStringForKey("name") --打印UserDefault中取出的值 print("name is ",ret) --打印Texture的信息 print(cc.Director:getInstance():getTextureCache():getCachedTextureInfo()) return pLayerendlocal helloScene = {}function helloScene.create() local scene = cc.Scene:create() local layer2 = mLayer.initlayer() scene:addChild(layer2) return sceneendcc.Director:getInstance():runWithScene(helloScene.create())
0 0
- Cocos2d-x3.2下Lua,UserDefault、Texture的使用
- cocos2d-x3.2 的UserDefault
- Cocos2d-x3.2 UserDefault用户数据 使用
- Cocos2d-x3.2 UserDefault用户数据
- cocos2d-x3.2 下使用多线程
- cocos2d-x3.2里lua文件,调用C++的接口
- Cocos2d-x3.2 定时器的使用
- Cocos2d-x3.2 定时器的使用
- cocos2d-x3.2 lua 返回键监听
- cocos2d 中UserDefault在windows平台下的路径问题
- cocos2d-x3.2下使用Umeng 64位SDK注意事项
- Cocos2d-x3.0下 Lua与C++相互调用
- Cocos2d-x3.0下 Lua与C++相互调用
- Cocos2d-x3.2下实现 可联动的表格
- cocos2d-x3.2在xcode6.1下的环境搭建
- cocos2d-x3.2在xcode6.1下的 环境搭建
- UserDefault的使用
- UserDefault的使用
- 所有浏览器为啥都带Mozilla
- Android Touch事件传递机制详解 上
- 黑马程序员 学习日记(十)
- 以u-boot为例介绍如何在MDK下调试elf格式文件
- LaTex中使用循环连续绘图的例子
- Cocos2d-x3.2下Lua,UserDefault、Texture的使用
- uboot.bin&zImage.bin编译步骤
- IOS 基于APNS消息推送原理与实现
- TCP 链路重置场景总结
- UVA11297--Census(二维线段树)
- 内存对齐
- git 服务器搭建纪要
- 项目1----------写自己的android录像机(1)
- 手机联系人文件丢失怎么恢复