From f82e96daf0ccfa4b1ed9d8267ff81b907140cb8b Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 3 Jul 2014 16:56:05 +0800 Subject: [PATCH] fix layout background image default color & opacity --- .../WidgetReader/LayoutReader/LayoutReader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 7fe7a9dcaa..1d8db7e9c3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -290,11 +290,14 @@ namespace cocostudio panel->setLayoutType((Layout::Type)DICTOOL->getIntValue_json(options, P_LayoutType)); - int bgimgcr = DICTOOL->getIntValue_json(options, P_ColorR); - int bgimgcg = DICTOOL->getIntValue_json(options, P_ColorG); - int bgimgcb = DICTOOL->getIntValue_json(options, P_ColorB); + int bgimgcr = DICTOOL->getIntValue_json(options, P_ColorR,255); + int bgimgcg = DICTOOL->getIntValue_json(options, P_ColorG,255); + int bgimgcb = DICTOOL->getIntValue_json(options, P_ColorB,255); panel->setBackGroundImageColor(Color3B(bgimgcr, bgimgcg, bgimgcb)); + int bgimgopacity = DICTOOL->getIntValue_json(options, "opacity",255); + panel->setBackGroundImageOpacity(bgimgopacity); + WidgetReader::setColorPropsFromJsonDictionary(widget, options); }