mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6893 from cocoscodeide/v3
update template project lua
This commit is contained in:
commit
7c7b1ce125
File diff suppressed because it is too large
Load Diff
|
@ -40,6 +40,21 @@
|
||||||
"*.lua"
|
"*.lua"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"from": "templates/lua-template-runtime/runtime/rtres",
|
||||||
|
"to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources/rtres",
|
||||||
|
"exclude": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": "templates/lua-template-runtime/runtime/rtres",
|
||||||
|
"to": "runtime/ios/PrebuiltRuntimeLua.app/rtres",
|
||||||
|
"exclude": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": "templates/lua-template-runtime/runtime/rtres",
|
||||||
|
"to": "runtime/win32/rtres",
|
||||||
|
"exclude": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"from": "cocos/scripting/lua-bindings/script",
|
"from": "cocos/scripting/lua-bindings/script",
|
||||||
"to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources",
|
"to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources",
|
||||||
|
|
|
@ -51,6 +51,13 @@ void ConfigParser::readConfig()
|
||||||
{
|
{
|
||||||
_initViewSize.width = objectInitView["width"].GetUint();
|
_initViewSize.width = objectInitView["width"].GetUint();
|
||||||
_initViewSize.height = objectInitView["height"].GetUint();
|
_initViewSize.height = objectInitView["height"].GetUint();
|
||||||
|
if (_initViewSize.height>_initViewSize.width)
|
||||||
|
{
|
||||||
|
float tmpvalue =_initViewSize.height;
|
||||||
|
_initViewSize.height = _initViewSize.width;
|
||||||
|
_initViewSize.width = tmpvalue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (objectInitView.HasMember("name") && objectInitView["name"].IsString())
|
if (objectInitView.HasMember("name") && objectInitView["name"].IsString())
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,50 +99,114 @@ bool reloadScript(const string& modulefile)
|
||||||
class ConnectWaitLayer: public Layer
|
class ConnectWaitLayer: public Layer
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
LabelTTF* pLabelUploadFile;
|
Label* _labelUploadFile;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ConnectWaitLayer()
|
ConnectWaitLayer()
|
||||||
{
|
{
|
||||||
string strip = getIPAddress();
|
int designWidth = 1280;
|
||||||
char szIPAddress[512]={0};
|
int designHeight = 800;
|
||||||
sprintf(szIPAddress, "LocalIP: %s",strip.c_str());
|
Director::getInstance()->getOpenGLView()->setDesignResolutionSize(designWidth,designHeight,ResolutionPolicy::EXACT_FIT);
|
||||||
auto label = LabelTTF::create(szIPAddress, "Arial", 24);
|
string playEnbleFile = "rtres/Play1.png";
|
||||||
addChild(label, 9999);
|
string shineFile = "rtres/shine.png";
|
||||||
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) );
|
string backgroundFile = "rtres/landscape.png";
|
||||||
|
if (!ConfigParser::getInstance()->isLanscape())
|
||||||
string strShowMsg ="";
|
|
||||||
if (CC_PLATFORM_WIN32 == CC_TARGET_PLATFORM || CC_PLATFORM_MAC == CC_TARGET_PLATFORM)
|
|
||||||
{
|
{
|
||||||
strShowMsg = "waiting for debugger to connect ...";
|
backgroundFile = "rtres/portrait.png";
|
||||||
|
Director::getInstance()->getOpenGLView()->setDesignResolutionSize(designHeight,designWidth,ResolutionPolicy::EXACT_FIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto background = Sprite::create(backgroundFile.c_str());
|
||||||
|
if (background)
|
||||||
|
{
|
||||||
|
background->setAnchorPoint(Vec2(0,0));
|
||||||
|
addChild(background,9999);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto playSprite = Sprite::create(playEnbleFile.c_str());
|
||||||
|
if (playSprite)
|
||||||
|
{
|
||||||
|
playSprite->setPosition(Vec2(902,400));
|
||||||
|
addChild(playSprite,9999);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
strShowMsg = "waiting for file transfer ...";
|
auto labelPlay = LabelTTF::create("play", "Arial", 108);
|
||||||
}
|
|
||||||
auto labelwait = LabelTTF::create(strShowMsg.c_str(), "Arial", 22);
|
|
||||||
addChild(labelwait, 10000);
|
|
||||||
labelwait->setPosition( Point(VisibleRect::center().x, VisibleRect::center().y) );
|
|
||||||
|
|
||||||
pLabelUploadFile = LabelTTF::create("", "Arial", 22);
|
|
||||||
addChild(pLabelUploadFile, 10000);
|
|
||||||
pLabelUploadFile->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
|
|
||||||
|
|
||||||
auto labelPlay = LabelTTF::create("play", "Arial", 36);
|
|
||||||
auto menuItem = MenuItemLabel::create(labelPlay, CC_CALLBACK_1(ConnectWaitLayer::playerCallback, this));
|
auto menuItem = MenuItemLabel::create(labelPlay, CC_CALLBACK_1(ConnectWaitLayer::playerCallback, this));
|
||||||
auto menu = Menu::create(menuItem, NULL);
|
auto menu = Menu::create(menuItem, NULL);
|
||||||
|
|
||||||
menu->setPosition( Point::ZERO );
|
menu->setPosition( Point::ZERO );
|
||||||
menuItem->setPosition( Point( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) );
|
menuItem->setPosition(Vec2(902,400));
|
||||||
|
if (!ConfigParser::getInstance()->isLanscape()) menuItem->setPosition(Vec2(400,500));
|
||||||
addChild(menu, 1);
|
addChild(menu, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto shineSprite = Sprite::create(shineFile.c_str());
|
||||||
|
if (shineSprite)
|
||||||
|
{
|
||||||
|
shineSprite->setPosition(Vec2(902,400));
|
||||||
|
shineSprite->runAction(RepeatForever::create(Sequence::createWithTwoActions(ScaleBy::create(1.0f, 1.08f),ScaleTo::create(1.0f, 1))));
|
||||||
|
addChild(shineSprite,9999);
|
||||||
|
}
|
||||||
|
|
||||||
|
string strip = getIPAddress();
|
||||||
|
char szIPAddress[512]={0};
|
||||||
|
sprintf(szIPAddress, "IP: %s",strip.c_str());
|
||||||
|
auto IPlabel = Label::create(szIPAddress, "Arial", 72);
|
||||||
|
IPlabel->setAnchorPoint(Vec2(0,0));
|
||||||
|
int spaceSizex = 72;
|
||||||
|
int spaceSizey = 200;
|
||||||
|
IPlabel->setPosition( Point(VisibleRect::leftTop().x+spaceSizex, VisibleRect::top().y -spaceSizey) );
|
||||||
|
addChild(IPlabel, 9999);
|
||||||
|
|
||||||
|
string strShowMsg = "waiting for file transfer ...";
|
||||||
|
if (CC_PLATFORM_WIN32 == CC_TARGET_PLATFORM || CC_PLATFORM_MAC == CC_TARGET_PLATFORM)
|
||||||
|
{
|
||||||
|
strShowMsg = "waiting for debugger to connect ...";
|
||||||
|
}
|
||||||
|
|
||||||
|
_labelUploadFile = Label::create(strShowMsg.c_str(), "Arial", 36);
|
||||||
|
_labelUploadFile->setAnchorPoint(Vec2(0,0));
|
||||||
|
_labelUploadFile->setPosition( Point(VisibleRect::leftTop().x+spaceSizex, IPlabel->getPositionY()-spaceSizex) );
|
||||||
|
_labelUploadFile->setAlignment(TextHAlignment::LEFT);
|
||||||
|
addChild(_labelUploadFile, 10000);
|
||||||
|
|
||||||
|
if (!ConfigParser::getInstance()->isLanscape())
|
||||||
|
{
|
||||||
|
if (playSprite) playSprite->setPosition(400,500);
|
||||||
|
if (shineSprite) shineSprite->setPosition(400,500);
|
||||||
|
_labelUploadFile->setAlignment(TextHAlignment::LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playSprite)
|
||||||
|
{
|
||||||
|
auto listener = EventListenerTouchOneByOne::create();
|
||||||
|
listener->onTouchBegan = [](Touch* touch, Event *event)->bool{
|
||||||
|
auto target = static_cast<Sprite*>(event->getCurrentTarget());
|
||||||
|
Vec2 point = target->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
|
||||||
|
auto rect = Rect(0, 0, target->getContentSize().width, target->getContentSize().height);
|
||||||
|
if (!rect.containsPoint(point)) return false;
|
||||||
|
target->stopAllActions();
|
||||||
|
target->runAction(Sequence::createWithTwoActions(ScaleBy::create(0.05f, 0.9f),ScaleTo::create(0.125f, 1)));
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
listener->onTouchEnded = [](Touch* touch, Event *event){
|
||||||
|
auto target = static_cast<Sprite*>(event->getCurrentTarget());
|
||||||
|
Vec2 point = target->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
|
||||||
|
auto rect = Rect(0, 0, target->getContentSize().width, target->getContentSize().height);
|
||||||
|
if (!rect.containsPoint(point)) return;
|
||||||
|
startScript("");
|
||||||
|
};
|
||||||
|
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, playSprite);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void playerCallback(Object* sender)
|
void playerCallback(Object* sender)
|
||||||
{
|
{
|
||||||
startScript("");
|
startScript("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void showCurRcvFile(string fileName) {
|
void showCurRcvFile(string fileName) {
|
||||||
pLabelUploadFile->setString(fileName);
|
_labelUploadFile->setString(fileName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,10 @@
|
||||||
"from": "../../../config.json",
|
"from": "../../../config.json",
|
||||||
"to": ""
|
"to": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"from": "../../../runtime/rtres",
|
||||||
|
"to": "rtres"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"from": "../../cocos2d-x/external/lua/luasocket",
|
"from": "../../cocos2d-x/external/lua/luasocket",
|
||||||
"to": "",
|
"to": "",
|
||||||
|
|
|
@ -128,6 +128,8 @@
|
||||||
C09BA7E718BC929700A85A3E /* WorkSpaceDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = C09BA7E418BC929700A85A3E /* WorkSpaceDialog.xib */; };
|
C09BA7E718BC929700A85A3E /* WorkSpaceDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = C09BA7E418BC929700A85A3E /* WorkSpaceDialog.xib */; };
|
||||||
C09BA7E818BC929700A85A3E /* WorkSpaceDialogController.mm in Sources */ = {isa = PBXBuildFile; fileRef = C09BA7E618BC929700A85A3E /* WorkSpaceDialogController.mm */; };
|
C09BA7E818BC929700A85A3E /* WorkSpaceDialogController.mm in Sources */ = {isa = PBXBuildFile; fileRef = C09BA7E618BC929700A85A3E /* WorkSpaceDialogController.mm */; };
|
||||||
C09BA7EE18BCA49600A85A3E /* NSAppSheetAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C09BA7ED18BCA49600A85A3E /* NSAppSheetAdditions.m */; };
|
C09BA7EE18BCA49600A85A3E /* NSAppSheetAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C09BA7ED18BCA49600A85A3E /* NSAppSheetAdditions.m */; };
|
||||||
|
C0F9D4BC192F3E6A0066134A /* rtres in Resources */ = {isa = PBXBuildFile; fileRef = C0F9D4BB192F3E6A0066134A /* rtres */; };
|
||||||
|
C0F9D4BD192F3E6A0066134A /* rtres in Resources */ = {isa = PBXBuildFile; fileRef = C0F9D4BB192F3E6A0066134A /* rtres */; };
|
||||||
D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; };
|
D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; };
|
||||||
F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };
|
F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };
|
||||||
F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };
|
F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };
|
||||||
|
@ -394,6 +396,7 @@
|
||||||
C09BA7E618BC929700A85A3E /* WorkSpaceDialogController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WorkSpaceDialogController.mm; sourceTree = "<group>"; };
|
C09BA7E618BC929700A85A3E /* WorkSpaceDialogController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WorkSpaceDialogController.mm; sourceTree = "<group>"; };
|
||||||
C09BA7EC18BCA49600A85A3E /* NSAppSheetAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAppSheetAdditions.h; sourceTree = "<group>"; };
|
C09BA7EC18BCA49600A85A3E /* NSAppSheetAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAppSheetAdditions.h; sourceTree = "<group>"; };
|
||||||
C09BA7ED18BCA49600A85A3E /* NSAppSheetAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSAppSheetAdditions.m; sourceTree = "<group>"; };
|
C09BA7ED18BCA49600A85A3E /* NSAppSheetAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSAppSheetAdditions.m; sourceTree = "<group>"; };
|
||||||
|
C0F9D4BB192F3E6A0066134A /* rtres */ = {isa = PBXFileReference; lastKnownFileType = folder; name = rtres; path = ../../../runtime/rtres; sourceTree = "<group>"; };
|
||||||
D6B061341803AC000077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
|
D6B061341803AC000077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
F293B3C815EB7BE500256477 /* HelloLua iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloLua iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
F293B3C815EB7BE500256477 /* HelloLua iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloLua iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
F293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
F293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||||
|
@ -642,6 +645,7 @@
|
||||||
F293BC4615EB859D00256477 /* Resources */ = {
|
F293BC4615EB859D00256477 /* Resources */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
C0F9D4BB192F3E6A0066134A /* rtres */,
|
||||||
C05D1C111923449100B808A4 /* config.json */,
|
C05D1C111923449100B808A4 /* config.json */,
|
||||||
C03781B718BF655400FE4F13 /* res */,
|
C03781B718BF655400FE4F13 /* res */,
|
||||||
C03781B818BF655400FE4F13 /* src */,
|
C03781B818BF655400FE4F13 /* src */,
|
||||||
|
@ -852,6 +856,7 @@
|
||||||
C08D5D5D18E567C6009071A4 /* ltn12.lua in Resources */,
|
C08D5D5D18E567C6009071A4 /* ltn12.lua in Resources */,
|
||||||
C03781EC18BF656A00FE4F13 /* luaoc.lua in Resources */,
|
C03781EC18BF656A00FE4F13 /* luaoc.lua in Resources */,
|
||||||
C07828F918B4D72E00BD2287 /* MainMenu.xib in Resources */,
|
C07828F918B4D72E00BD2287 /* MainMenu.xib in Resources */,
|
||||||
|
C0F9D4BD192F3E6A0066134A /* rtres in Resources */,
|
||||||
5023817617EBBE3400990C9B /* Icon.icns in Resources */,
|
5023817617EBBE3400990C9B /* Icon.icns in Resources */,
|
||||||
C03781D218BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
|
C03781D218BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
|
||||||
C08D5D5F18E567C6009071A4 /* mbox.lua in Resources */,
|
C08D5D5F18E567C6009071A4 /* mbox.lua in Resources */,
|
||||||
|
@ -894,6 +899,7 @@
|
||||||
C03781F118BF656A00FE4F13 /* StudioConstants.lua in Resources */,
|
C03781F118BF656A00FE4F13 /* StudioConstants.lua in Resources */,
|
||||||
5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,
|
5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,
|
||||||
C03781D118BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
|
C03781D118BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
|
||||||
|
C0F9D4BC192F3E6A0066134A /* rtres in Resources */,
|
||||||
5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,
|
5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,
|
||||||
C03781CF18BF656A00FE4F13 /* AudioEngine.lua in Resources */,
|
C03781CF18BF656A00FE4F13 /* AudioEngine.lua in Resources */,
|
||||||
C03781B918BF655400FE4F13 /* res in Resources */,
|
C03781B918BF655400FE4F13 /* res in Resources */,
|
||||||
|
|
|
@ -98,16 +98,16 @@ std::string getCurAppPath(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!g_landscape)
|
||||||
|
{
|
||||||
|
float tmpvalue =width;
|
||||||
|
width = height;
|
||||||
|
height = tmpvalue;
|
||||||
|
}
|
||||||
|
|
||||||
g_eglView = GLView::createWithRect([viewName cStringUsingEncoding:NSUTF8StringEncoding],cocos2d::Rect(0.0f,0.0f,width,height),frameZoomFactor);
|
g_eglView = GLView::createWithRect([viewName cStringUsingEncoding:NSUTF8StringEncoding],cocos2d::Rect(0.0f,0.0f,width,height),frameZoomFactor);
|
||||||
auto director = Director::getInstance();
|
auto director = Director::getInstance();
|
||||||
director->setOpenGLView(g_eglView);
|
director->setOpenGLView(g_eglView);
|
||||||
g_landscape = false;
|
|
||||||
g_screenSize.width = width;
|
|
||||||
g_screenSize.height = height;
|
|
||||||
if (width > height)
|
|
||||||
{
|
|
||||||
g_landscape = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = glfwGetCocoaWindow(g_eglView->getWindow());
|
window = glfwGetCocoaWindow(g_eglView->getWindow());
|
||||||
[NSApp setDelegate: self];
|
[NSApp setDelegate: self];
|
||||||
|
@ -124,12 +124,15 @@ void createSimulator(const char* viewName, float width, float height,bool isLand
|
||||||
{
|
{
|
||||||
if(g_nsAppDelegate)
|
if(g_nsAppDelegate)
|
||||||
{
|
{
|
||||||
if((isLandscape && height > width) || (!isLandscape && width > height))
|
g_landscape = isLandscape;
|
||||||
|
if(height > width)
|
||||||
{
|
{
|
||||||
float tmpvalue =width;
|
float tmpvalue =width;
|
||||||
width = height;
|
width = height;
|
||||||
height = tmpvalue;
|
height = tmpvalue;
|
||||||
}
|
}
|
||||||
|
g_screenSize.width = width;
|
||||||
|
g_screenSize.height = height;
|
||||||
|
|
||||||
[g_nsAppDelegate createSimulator:[NSString stringWithUTF8String:viewName] viewWidth:width viewHeight:height factor:frameZoomFactor];
|
[g_nsAppDelegate createSimulator:[NSString stringWithUTF8String:viewName] viewWidth:width viewHeight:height factor:frameZoomFactor];
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,9 +109,11 @@ if exist "$(OutDir)\Resource" rd /s /q "$(OutDir)\Resource"
|
||||||
mkdir "$(OutDir)\Resource"
|
mkdir "$(OutDir)\Resource"
|
||||||
mkdir "$(OutDir)\Resource\src"
|
mkdir "$(OutDir)\Resource\src"
|
||||||
mkdir "$(OutDir)\Resource\res"
|
mkdir "$(OutDir)\Resource\res"
|
||||||
|
mkdir "$(OutDir)\Resource\rtres"
|
||||||
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
|
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
|
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
|
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
|
||||||
|
xcopy "$(ProjectDir)..\..\..\runtime\rtres" "$(OutDir)\Resource\rtres" /e /Y
|
||||||
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
|
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
|
||||||
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
|
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
|
||||||
<Message>copy files</Message>
|
<Message>copy files</Message>
|
||||||
|
@ -165,9 +167,11 @@ if exist "$(OutDir)\Resource" rd /s /q "$(OutDir)\Resource"
|
||||||
mkdir "$(OutDir)\Resource"
|
mkdir "$(OutDir)\Resource"
|
||||||
mkdir "$(OutDir)\Resource\src"
|
mkdir "$(OutDir)\Resource\src"
|
||||||
mkdir "$(OutDir)\Resource\res"
|
mkdir "$(OutDir)\Resource\res"
|
||||||
|
mkdir "$(OutDir)\Resource\rtres"
|
||||||
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
|
xcopy "$(ProjectDir)..\..\cocos2d-x\cocos\scripting\lua-bindings\script" "$(OutDir)\Resource" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
|
xcopy "$(ProjectDir)..\..\..\src" "$(OutDir)\Resource\src" /e /Y
|
||||||
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
|
xcopy "$(ProjectDir)..\..\..\res" "$(OutDir)\Resource\res" /e /Y
|
||||||
|
xcopy "$(ProjectDir)..\..\..\runtime\rtres" "$(OutDir)\Resource\rtres" /e /Y
|
||||||
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
|
copy "$(ProjectDir)..\..\..\config.json" "$(OutDir)\Resource\config.json" /Y
|
||||||
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
|
xcopy "$(ProjectDir)..\..\cocos2d-x\external\lua\luasocket\*.lua" "$(OutDir)\Resource" /e /Y</Command>
|
||||||
<Message>copy files</Message>
|
<Message>copy files</Message>
|
||||||
|
|
|
@ -308,7 +308,17 @@ void createSimulator(const char* viewName, float width, float height, bool isLan
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((isLandscape && height > width) || (!isLandscape && width > height))
|
g_landscape = isLandscape;
|
||||||
|
if(height > width)
|
||||||
|
{
|
||||||
|
float tmpvalue =width;
|
||||||
|
width = height;
|
||||||
|
height = tmpvalue;
|
||||||
|
}
|
||||||
|
g_screenSize.width = width;
|
||||||
|
g_screenSize.height = height;
|
||||||
|
|
||||||
|
if(!g_landscape)
|
||||||
{
|
{
|
||||||
float tmpvalue =width;
|
float tmpvalue =width;
|
||||||
width = height;
|
width = height;
|
||||||
|
@ -318,13 +328,6 @@ void createSimulator(const char* viewName, float width, float height, bool isLan
|
||||||
g_eglView = GLView::createWithRect(viewName,Rect(0,0,width,height),frameZoomFactor);
|
g_eglView = GLView::createWithRect(viewName,Rect(0,0,width,height),frameZoomFactor);
|
||||||
auto director = Director::getInstance();
|
auto director = Director::getInstance();
|
||||||
director->setOpenGLView(g_eglView);
|
director->setOpenGLView(g_eglView);
|
||||||
g_landscape = false;
|
|
||||||
g_screenSize.width = width;
|
|
||||||
g_screenSize.height = height;
|
|
||||||
if (width > height)
|
|
||||||
{
|
|
||||||
g_landscape = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
HWND hWnd=glfwGetWin32Window(g_eglView->getWindow());
|
HWND hWnd=glfwGetWin32Window(g_eglView->getWindow());
|
||||||
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MENU_COCOS));
|
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MENU_COCOS));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version":"v3-lua-runtime-1.1.1",
|
"version":"v3-lua-runtime-1.1.2",
|
||||||
"zip_file_size":"20854899",
|
"zip_file_size":"21402175",
|
||||||
"repo_name":"cocos-runtime-bin",
|
"repo_name":"cocos-runtime-bin",
|
||||||
"repo_parent":"https://github.com/chukong/"
|
"repo_parent":"https://github.com/chukong/"
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
Binary file not shown.
After Width: | Height: | Size: 131 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue