分类 IT Technology 下的文章

改动如下:

if CONFIG_SCREEN_AUTOSCALE and CONFIG_SCREEN_AUTOSCALE ~="NONE" then
    if type(CONFIG_SCREEN_AUTOSCALE_CALLBACK) == "function" then
        scaleX, scaleY = CONFIG_SCREEN_AUTOSCALE_CALLBACK(w, h, device.model)
    end

-    if CONFIG_SCREEN_AUTOSCALE == "FILL_ALL" then
+    if CONFIG_SCREEN_AUTOSCALE == "EXACT_FIT" then
+        scale = 1.0
+        glview:setDesignResolutionSize(CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT, cc.ResolutionPolicy.EXACT_FIT)
+    elseif CONFIG_SCREEN_AUTOSCALE == "FILL_ALL" then
        CONFIG_SCREEN_WIDTH = w
        CONFIG_SCREEN_HEIGHT = h
        scale = 1.0
        if cc.bPlugin_ then
            glview:setDesignResolutionSize(CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT, cc.ResolutionPolicy.NO_BORDER)
        else
-            glview:setDesignResolutionSize(CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT, cc.ResolutionPolicy.FILL_ALL)
+            glview:setDesignResolutionSize(CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT, cc.ResolutionPolicy.SHOW_ALL)
            end

spineAnimation为创建的spine骨骼动画。

spineAnimation:registerSpineEventHandler(function (event)
    dump(event)
end, sp.EventType.ANIMATION_END)

事件有以下类型:

sp.EventType =
{
    ANIMATION_START = 0, 
    ANIMATION_END = 1, 
    ANIMATION_COMPLETE = 2, 
    ANIMATION_EVENT = 3,
}
注:不在在骨骼动画事件中调用spineAnimation:removeFromParent(), spine runtime会异常的。用调度器来解决这个问题。

首先在 http://www.cmake.org/download/ 下载对应系统 dmg 包。
安装完成后,在控制台运行下面的命令已创建链接。

osascript -e 'do shell script "ln -sf \"/Applications/CMake.app/Contents/bin/cmake\" /usr/bin/cmake" with administrator privileges'

Cocos2d-Lua(Quick-cocos2d-x) 集成有 Player 模拟器,可以快速测试 Lua 游戏代码。
当游戏开发完成,需要打包发布的时候,我们不希望 Lua 源代码以明文的方式暴露在 apk 或 ipa 包中,否则你的辛苦劳动成果将被轻易剽窃。Quick框架已为我们提供了这方面的支持。
本文记录ipa打包加密Lua全过程。

阅读剩余部分

今日使用pip list,出现一堆错误:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 80, in run
    self.run_listing(options)
  File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 127, in run_listing
    self.output_package_listing(installed_packages)
  File "/Library/Python/2.7/site-packages/pip/commands/list.py", line 136, in output_package_listing
    if dist_is_editable(dist):
  File "/Library/Python/2.7/site-packages/pip/util.py", line 347, in dist_is_editable
    req = FrozenRequirement.from_dist(dist, [])
  File "/Library/Python/2.7/site-packages/pip/__init__.py", line 194, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

阅读剩余部分