From 432bdf3541c8c6db1bd1eab67d01902bb511d943 Mon Sep 17 00:00:00 2001 From: dualface Date: Wed, 31 Dec 2014 18:01:03 +0800 Subject: [PATCH] fix framework on iOS --- cocos/scripting/lua-bindings/script/framework/device.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos/scripting/lua-bindings/script/framework/device.lua b/cocos/scripting/lua-bindings/script/framework/device.lua index ea73f08812..acf7746c43 100644 --- a/cocos/scripting/lua-bindings/script/framework/device.lua +++ b/cocos/scripting/lua-bindings/script/framework/device.lua @@ -37,6 +37,9 @@ elseif target == cc.PLATFORM_OS_ANDROID then device.platform = "android" elseif target == cc.PLATFORM_OS_IPHONE or target == cc.PLATFORM_OS_IPAD then device.platform = "ios" + local director = cc.Director:getInstance() + local view = director:getOpenGLView() + local framesize = view:getFrameSize() local w, h = framesize.width, framesize.height if w == 640 and h == 960 then device.model = "iphone 4"