This commit is contained in:
bofeng-song 2014-05-23 19:22:14 +08:00
commit 517ab063fb
17 changed files with 107 additions and 10 deletions

View File

@ -3,6 +3,7 @@ cocos2d-x-3.1 ???
[FIX] Label: using outline and invoking 'Director::setContentScaleFactor' cause label show nothing
[FIX] ProgressTo: will start from 0 when it reaches 100
[FIX] Physics integration: may crashes if remove bodies at physics contact callback
[FIX] UIWidget: copyProperties() lost copy some properties
[FIX] WP8: orientation is not correct when it is set to portrait
[FIX] WP8: fix for precompiled shaders and precompiled headers
[FIX] WP8: template supports orientation

View File

@ -31,7 +31,7 @@ NS_CC_BEGIN
const char* cocos2dVersion()
{
return "cocos2d-x 3.1rc0";
return "cocos2d-x 3.1";
}
NS_CC_END

View File

@ -615,6 +615,9 @@ void CheckBox::copySpecialProperties(Widget *widget)
loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName, checkBox->_backGroundDisabledTexType);
loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName, checkBox->_frontCrossDisabledTexType);
setSelectedState(checkBox->_isSelected);
_checkBoxEventListener = checkBox->_checkBoxEventListener;
_checkBoxEventSelector = checkBox->_checkBoxEventSelector;
_checkBoxEventCallback = checkBox->_checkBoxEventCallback;
}
}

View File

@ -1515,6 +1515,8 @@ void Layout::copySpecialProperties(Widget *widget)
setLayoutType(layout->_layoutType);
setClippingEnabled(layout->_clippingEnabled);
setClippingType(layout->_clippingType);
_loopFocus = layout->_loopFocus;
_passFocusToChild = layout->_passFocusToChild;
}
}

View File

@ -502,6 +502,9 @@ void ListView::copySpecialProperties(Widget *widget)
setItemModel(listViewEx->_model);
setItemsMargin(listViewEx->_itemsMargin);
setGravity(listViewEx->_gravity);
_listViewEventListener = listViewEx->_listViewEventListener;
_listViewEventSelector = listViewEx->_listViewEventSelector;
_eventCallback = listViewEx->_eventCallback;
}
}

View File

@ -626,6 +626,9 @@ void PageView::copySpecialProperties(Widget *widget)
if (pageView)
{
Layout::copySpecialProperties(widget);
_eventCallback = pageView->_eventCallback;
_pageViewEventListener = pageView->_pageViewEventListener;
_pageViewEventSelector = pageView->_pageViewEventSelector;
}
}

View File

@ -1738,6 +1738,9 @@ void ScrollView::copySpecialProperties(Widget *widget)
setDirection(scrollView->_direction);
setBounceEnabled(scrollView->_bounceEnabled);
setInertiaScrollEnabled(scrollView->_inertiaScrollEnabled);
_scrollViewEventListener = scrollView->_scrollViewEventListener;
_scrollViewEventSelector = scrollView->_scrollViewEventSelector;
_eventCallback = scrollView->_eventCallback;
}
}

View File

@ -627,6 +627,9 @@ void Slider::copySpecialProperties(Widget *widget)
loadSlidBallTexturePressed(slider->_slidBallPressedTextureFile, slider->_ballPTexType);
loadSlidBallTextureDisabled(slider->_slidBallDisabledTextureFile, slider->_ballDTexType);
setPercent(slider->getPercent());
_sliderEventListener = slider->_sliderEventListener;
_sliderEventSelector = slider->_sliderEventSelector;
_eventCallback = slider->_eventCallback;
}
}

View File

@ -842,6 +842,9 @@ void TextField::copySpecialProperties(Widget *widget)
setDetachWithIME(textField->getDetachWithIME());
setInsertText(textField->getInsertText());
setDeleteBackward(textField->getDeleteBackward());
_eventCallback = textField->_eventCallback;
_textFieldEventListener = textField->_textFieldEventListener;
_textFieldEventSelector = textField->_textFieldEventSelector;
}
}

View File

@ -77,6 +77,9 @@ namespace experimental{
virtual void draw(Renderer *renderer, const Mat4& transform, bool transformUpdated) override;
protected:
virtual cocos2d::ui::Widget* createCloneInstance() override;
virtual void copySpecialProperties(Widget* model) override;
VideoPlayer();
virtual ~VideoPlayer();

View File

@ -355,6 +355,28 @@ void VideoPlayer::onPlayEvent(VideoPlayer::EventType event)
}
}
cocos2d::ui::Widget* VideoPlayer::createCloneInstance()
{
return VideoPlayer::create();
}
void VideoPlayer::copySpecialProperties(Widget *widget)
{
VideoPlayer* videoPlayer = dynamic_cast<VideoPlayer*>(widget);
if (videoPlayer)
{
_isPlaying = videoPlayer->_isPlaying;
_fullScreenEnabled = videoPlayer->_fullScreenEnabled;
_fullScreenDirty = videoPlayer->_fullScreenDirty;
_videoURL = videoPlayer->_videoURL;
_keepAspectRatioEnabled = videoPlayer->_keepAspectRatioEnabled;
_videoSource = videoPlayer->_videoSource;
_videoPlayerIndex = videoPlayer->_videoPlayerIndex;
_eventCallback = videoPlayer->_eventCallback;
_videoView = videoPlayer->_videoView;
}
}
void executeVideoCallback(int index,int event)
{
auto it = s_allVideoPlayers.find(index);

View File

@ -461,4 +461,26 @@ void VideoPlayer::onPlayEvent(VideoPlayer::EventType event)
}
}
cocos2d::ui::Widget* VideoPlayer::createCloneInstance()
{
return VideoPlayer::create();
}
void VideoPlayer::copySpecialProperties(Widget *widget)
{
VideoPlayer* videoPlayer = dynamic_cast<VideoPlayer*>(widget);
if (videoPlayer)
{
_isPlaying = videoPlayer->_isPlaying;
_fullScreenEnabled = videoPlayer->_fullScreenEnabled;
_fullScreenDirty = videoPlayer->_fullScreenDirty;
_videoURL = videoPlayer->_videoURL;
_keepAspectRatioEnabled = videoPlayer->_keepAspectRatioEnabled;
_videoSource = videoPlayer->_videoSource;
_videoPlayerIndex = videoPlayer->_videoPlayerIndex;
_eventCallback = videoPlayer->_eventCallback;
_videoView = videoPlayer->_videoView;
}
}
#endif

View File

@ -925,7 +925,6 @@ void Widget::copyProperties(Widget *widget)
_ignoreSize = widget->_ignoreSize;
_size = widget->_size;
_customSize = widget->_customSize;
copySpecialProperties(widget);
_sizeType = widget->getSizeType();
_sizePercent = widget->_sizePercent;
_positionType = widget->_positionType;
@ -941,6 +940,14 @@ void Widget::copyProperties(Widget *widget)
setFlippedY(widget->isFlippedY());
setColor(widget->getColor());
setOpacity(widget->getOpacity());
_touchEventCallback = widget->_touchEventCallback;
_touchEventListener = widget->_touchEventListener;
_touchEventSelector = widget->_touchEventSelector;
_focused = widget->_focused;
_focusEnabled = widget->_focusEnabled;
copySpecialProperties(widget);
//FIXME:copy focus properties, also make sure all the subclass the copy behavior is correct
Map<int, LayoutParameter*>& layoutParameterDic = widget->_layoutParameterDictionary;
for (auto iter = layoutParameterDic.begin(); iter != layoutParameterDic.end(); ++iter)

View File

@ -40,6 +40,21 @@
"*.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",
"to": "runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources",

View File

@ -149,11 +149,12 @@ public:
string strip = getIPAddress();
char szIPAddress[512]={0};
sprintf(szIPAddress, "LocalIP: %s",strip.c_str());
auto IPlabel = Label::create(szIPAddress, "Arial", 36);
sprintf(szIPAddress, "IP: %s",strip.c_str());
auto IPlabel = Label::create(szIPAddress, "Arial", 72);
IPlabel->setAnchorPoint(Vec2(0,0));
int spaceSize = 72;
IPlabel->setPosition( Point(VisibleRect::leftTop().x+spaceSize, VisibleRect::top().y -spaceSize) );
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 ...";
@ -162,9 +163,9 @@ public:
strShowMsg = "waiting for debugger to connect ...";
}
_labelUploadFile = Label::create(strShowMsg.c_str(), "Arial", 24);
_labelUploadFile = Label::create(strShowMsg.c_str(), "Arial", 36);
_labelUploadFile->setAnchorPoint(Vec2(0,0));
_labelUploadFile->setPosition( Point(VisibleRect::leftTop().x+spaceSize, IPlabel->getPositionY()-spaceSize) );
_labelUploadFile->setPosition( Point(VisibleRect::leftTop().x+spaceSizex, IPlabel->getPositionY()-spaceSizex) );
_labelUploadFile->setAlignment(TextHAlignment::LEFT);
addChild(_labelUploadFile, 10000);

View File

@ -128,6 +128,8 @@
C09BA7E718BC929700A85A3E /* WorkSpaceDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = C09BA7E418BC929700A85A3E /* WorkSpaceDialog.xib */; };
C09BA7E818BC929700A85A3E /* WorkSpaceDialogController.mm in Sources */ = {isa = PBXBuildFile; fileRef = C09BA7E618BC929700A85A3E /* WorkSpaceDialogController.mm */; };
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 */; };
F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.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>"; };
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>"; };
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; };
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; };
@ -642,6 +645,7 @@
F293BC4615EB859D00256477 /* Resources */ = {
isa = PBXGroup;
children = (
C0F9D4BB192F3E6A0066134A /* rtres */,
C05D1C111923449100B808A4 /* config.json */,
C03781B718BF655400FE4F13 /* res */,
C03781B818BF655400FE4F13 /* src */,
@ -852,6 +856,7 @@
C08D5D5D18E567C6009071A4 /* ltn12.lua in Resources */,
C03781EC18BF656A00FE4F13 /* luaoc.lua in Resources */,
C07828F918B4D72E00BD2287 /* MainMenu.xib in Resources */,
C0F9D4BD192F3E6A0066134A /* rtres in Resources */,
5023817617EBBE3400990C9B /* Icon.icns in Resources */,
C03781D218BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
C08D5D5F18E567C6009071A4 /* mbox.lua in Resources */,
@ -894,6 +899,7 @@
C03781F118BF656A00FE4F13 /* StudioConstants.lua in Resources */,
5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,
C03781D118BF656A00FE4F13 /* CCBReaderLoad.lua in Resources */,
C0F9D4BC192F3E6A0066134A /* rtres in Resources */,
5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,
C03781CF18BF656A00FE4F13 /* AudioEngine.lua in Resources */,
C03781B918BF655400FE4F13 /* res in Resources */,

View File

@ -1,6 +1,6 @@
{
"version":"v3-lua-runtime-1.1.1",
"zip_file_size":"20854899",
"version":"v3-lua-runtime-1.1.2",
"zip_file_size":"21402175",
"repo_name":"cocos-runtime-bin",
"repo_parent":"https://github.com/chukong/"
}