- 博客(29)
- 资源 (9)
- 收藏
- 关注
原创 利用fontmin给cocos2d-x游戏字体瘦身
清宫Q传有很多文本需要显示,同时为了效果也使用了很多种不同的字体,导致字体文件占据程序包很大比例的空间,搜索了一下,找到了一款工具fontmin可以有效减少字体大小。fontmin简介fontmin是一个纯 JavaScript 实现的字体子集化方案,提供了 ttf 子集化,eot/woff/svg格式转换,css 生成等功能。虽说是被设计用来提升网页体验的,但也可以通过减少字体体积从而减少iOS/
2016-07-27 13:24:25 2526 1
原创 cocos2d-lua android解决启动时因为资源加载而黑屏的问题
cocos2d-lua android解决启动时因为资源加载而黑屏的问题
2016-07-08 22:57:14 8837 4
原创 Cocos2d-lua自动重新加载SpriteFrames
收到 didReceiveMemoryWarning之后Cocos2d-lua自动重新加载SpriteFrames
2016-05-04 16:30:15 8240 1
原创 升级到cocos2d-x 3.10之后被遗忘的ccui.PageView.pageTurningEvent()
升级到cocos2d-x 3.10之后被遗忘的ccui.PageView.pageTurningEvent()
2016-05-03 19:34:27 5409 1
原创 为安卓App加个退出键
近期需要把一款手游迁移到Android上,由于一直用cocos2d-lua,对Android不熟悉,漏掉了退出键的实现,在测试童鞋的反馈下才意识到。想着这些问题一定有很多Android前辈遇到过,翻墙一查,还没看到解决方法,先看到一场关于『结束正在运行的Android程序』的争论,见StackOverflow这里。提问者的疑问是,为什么安卓系统决定了何时退出App,而不是用户决定。
2016-05-02 22:31:20 2115
原创 cocos2d-lua集成Mob-SMSSDK-for-android
新项目使用cocos2d-lua(based on cocos2d-x 3.6 and quick 3.5)开发,需要集成SMSSDK。 SMSSDK分别对iOS/android平台提供了SDK,由于没有android开发经验,在集成android SDK的时候遇到了很多问题,也花了很多时间解决,在此记录一下。
2015-10-24 22:44:25 2507
原创 Polymorphism in CSharp
Polymorphism in CSharpThere are three kinds of polymorphism in CSharpCompile time polymorphismRuntime polymorphismParametric polymorphismExamplesPolymorphism in CSharpThere are three kinds of pol
2015-04-20 18:58:00 1541
原创 [Unity3D]调用函数时出现NullReferenceException的一个可能原因
今天遇到一个报错,如下图:NullReferenceException UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineMonoBehaviour.cs:6
2014-11-27 14:20:16 23804 4
原创 import in python
import做了什么在sys.modules中寻找该模块是否之前被引入过,如果有,引入该名字[import mode相当于mod = sys.modules['mod']]如果没有:在sys.path中寻找该模块,如果没找到,报错如果找到,创建一个空的模块对象,通常为dict()将该模块写入sys.modules加载该模块文件(如果有必要,先编译)执行该模块代码,def, im
2014-08-11 16:47:54 2451
转载 Running Your iOS App in the Simulator From The Command Line
While Apple doesn’t provide an “official” way to launch an app in the iOS Simulator from the command line, there’s a few private tricks we can employ.First, the iOS Simulator app itself is located i
2013-08-09 15:35:25 2419
原创 iOS crash log report tools
crashlyticshttp://try.crashlytics.com/HockeyApphttp://hockeyapp.net/
2013-05-04 14:30:09 1942
转载 Compiler Warnings for Objective-C Developers
Compiler warnings are one of the most helpful tools for developers. The compiler can not only warn you about obvious mistakes (such as a method you forgot to implement); it also identifies many code p
2013-04-29 13:37:51 2651
转载 Why C++ Supports both Class and Typename for Type Parameters
Recently, someone asked me why we support both class and typename within C++ to indicate a type parameter since the keywords do not hold any platform significance – for example, class is not meant to
2012-03-21 14:50:05 1619
原创 Shell编程笔记(未完待续)
1.shell中单双引号的区别 单引号关闭所有有特殊作用的字符而双引号只要求shell忽略大多数,除了①美元符号②反引号③反斜杠,这3种特殊字符不被忽略。具体而言:单引号包括的内容均被原样输出双引号会做变量替换,命令替换和转义,除此之外原样输出示例:#!/bin/bashDT="today is" SINGLEQUOTE='\"$DT
2012-03-20 10:06:28 1631
原创 C++中POD是什么?
什么是POD? POD 的全称是 Plain Old Data,在C++标准中,POD是这样定义的: Arithmetic types (3.9.1), enumeration types, pointer types, and pointer to member types (3.9.2), and cv-qualified(注2) versions of these types (3.
2012-03-19 15:41:54 9973
翻译 char **和char *[M]有什么区别?
原文链接在此在函数参数中,extern int func(char **);和extern int func(char *[M]);是代表不同含义的。前者表示函数期望一个指针,该指针指向一块内存,该内存中包含N个指针,每个指针指向一块内存;这些指针指向的内存可能是连续的,也可能不连续,长度并且不一定相同;其中&a[0][0]和&[1][0]无
2012-03-05 15:31:03 4416
原创 为什么不能使用成员变量的值作为成员函数的默认参数?
在解决工作中遇到一个问题时,我定义了一个类c(如下所示),包含两个功能类似的公共查询接口Rate()和Rate(char bs_flag, char sh_flag),二者的区别是,在实例化对象的时候,会包含bs_flag和sh_flag,因此我希望有一个不用指定查询条件的Rate函数,用来反映默认情形;但有时又需要变更查询条件查询,如第二个指定查询条件的Rate函数,那么能否将这两个函数合并呢?
2012-03-01 17:00:14 4668
原创 在operator=或拷贝构造中对所有数据成员赋值
1. operator=赋值操作符Effective C++条款16中描述到,在派生类中重写赋值操作符函数时,要注意不要忘记对基类对象部分也要赋值,而这一点恐怕是许多新手容易忘记的,他们很自然地不会想到这一点(例如我),比如下述代码:class CBase{public: CBase& operator=(const CBase& another) {
2012-02-29 16:11:57 1775
原创 C++异常处理 -- 异常对象(Exception Object)
在C++异常处理中,throw可以抛出任何对象,可以是int类型,也可以是class类型,对于catch块而言,有两种选择:1)catch这个类型,例:int main(){ int a=1; try { throw a; } catch(int) // 捕获int型异常,无法获知a的内容 { cout<
2012-02-28 15:34:22 4729
原创 多机调度问题的贪心解法
多机调度问题:有n个独立的作业需要在m台相同的机器上进行加工处理. 作业i需要的加工时间为ti. 每个作业可以任选一台机器加工, 但加工结束前不能中断, 作业不允许拆分.要求给一种作业调度方案, 使所给的n个作业在尽可能短的时间内完成.问题分析:为什么是NP问题? (待求证)问题解答:采用最长处理时间作业优先的贪心选择策略可以设计出较好的近似算法
2012-02-15 10:25:15 8475
原创 二分搜索(BinarySearch)的分治思想C语言实现
二分搜索是常用的搜索算法, 要求给定的元素集合非递减排序, 根据给定待查找元素, 查找其索引, 如果未找到, 返回-1.代码为:// 二分搜索 5 // @pre : a非递减序, 且长度为len 6 // @post: 返回x在a中的索引或-1 7 int binary_search(int a[], int len, int x)
2012-02-14 13:33:01 2704
原创 字符组合问题的分治算法
题目是这样的:把一个字符串中所有字符的所有可能的组合打印出来(字符串中没有重复的字符),不考虑字符顺序('123'和'312'是一样的)该算法使用分治思想的C语言描述如下:void generate_all_combinations(char *str, int len, char *prefix){ if (len==0) {
2012-02-14 09:18:40 1178
转载 Linux多线程函数解析
Linux多线程函数解析Linux多线程函数用得比较多的是下面的3个pthread_create(),pthread_exit(),pthread_join();它们都是在头文件之中。编译时需要加静态库-lpthread 下面是函数的说明: pthread_create是UNIX环境创建线程函数 int pthread_create( pthread_t *
2011-12-29 13:57:14 869
原创 使用const_cast转换全局const变量导致程序崩溃的原因
#include using namespace std;const int gc_var = 300;int main(){ const int lc_blah = 100; int &l_blah = const_cast(lc_blah); l_blah = 200; cout<<"l_blah: "<<l_blah<<endl; // Will
2011-12-29 12:28:26 2091
翻译 如何拖动文件到python脚本中作为输入参数?
默认情况下,我们无法拖放一个文件给python脚本让其去处理这个文件,这是因为windows认为python脚本不是一个合法的可拖放的目的对象(drop target)。为了实现拖放目的,我们只需在注册表中配置一下即可,具体做法为:新建.reg文件,文件名随意,内容为:W
2011-08-17 16:30:23 17719 5
原创 如何在linux下快速替换多个文件的文本?
哥现在参与的产品无比庞大,每次部署环境,都要修改无数配置文件,让开发/测试尤其是去客户现场实施的人员头疼不已.据粗略估计,有数十个模块,每个模块下面一个配置文件,模块之间藕断丝连,有着难以割舍的关系--当然,如果不该割的割了,就要出大问题了,你懂的--,这其中,配置文件起着决定性的调度作用,模块与模块的沟通协作,可以说,是靠着配置文件实现的. 问题是什么呢?由于需要去不同的客户处安装我们的系统,而每个客户的具体环境又是不同的,诸如IP,端口等基本设置就要进行批量修改,如果没有合适的工具或命
2011-02-19 13:19:00 4043
原创 如何在shell中快速切换目录?
<br />经常在shell下工作的筒子们经常会在不同的目录来回切换,那么,如何能提高切换的效率呢?不用每次手动输入cd /path/to/dir1; cd /path/to/dir2?<br />在只有两个目录的情况下,有个很简单也很直观的办法:<br />$ cd - #表示回到之前的目录 <br />多说一句,这个-还有其他的一个典型用法:如果文件名参数是一个单破折号"-",表示从标准输入读取文件列表:
2011-02-16 14:44:00 3896
原创 linux如何根据进程ID查找启动程序的路径
<br />昨天遇到一个问题,背景是这样的:我们工作环境不正常,使用ps命令查看,发现有程序A的两个进程状态一个是<defunct>状态,一个是正常运行.由于该程序A是个通用服务程序,被拷贝成多份,分发到不同的目录中单独启动,只有各自配置不同而已,因此想知道是哪个目录的A程序处于僵死状态.<br /><br />正常运行中的进程树关系如下(为了简化,只显示一部分进程):<br />$ ps x<br /> PID TTY STAT TIME COMMAND<br />1727
2011-02-15 14:12:00 24104
Odin Validator V3.1.6 Unity3D
2022-10-25
ShapesV2.3.2
2020-11-17
ALineV1.3.1
2020-11-17
EasySave3.unitypackage
2020-07-26
EnhancedScrollerV2.25.1.unitypackage
2020-07-17
AstarPathfindingProjectV4.2.15.unitypackage
2020-04-17
OdinInspectorV2.1.11.unitypackage
2020-04-15
AntiCheatToolkitV2.2.1.unitypackage
2020-04-15
MoreEffectCoroutinesProV3.10.1.unitypackage
2020-04-15
MoreEffectiveCoroutinesV3.08.0.unitypackage
2019-12-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人