mirror of https://github.com/axmolengine/axmol.git
change layout scale9 rendering type to simple
This commit is contained in:
parent
4c99bdf04f
commit
df44b164ef
|
@ -557,8 +557,12 @@ void Layout::setBackGroundImageScale9Enabled(bool able)
|
||||||
addBackGroundImage();
|
addBackGroundImage();
|
||||||
setBackGroundImage(_backGroundImageFileName,_bgImageTexType);
|
setBackGroundImage(_backGroundImageFileName,_bgImageTexType);
|
||||||
}
|
}
|
||||||
_backGroundImage->setScale9Enabled(_backGroundScale9Enabled);
|
if(_backGroundScale9Enabled){
|
||||||
|
_backGroundImage->setRenderingType(Scale9Sprite::RenderingType::SLICE);
|
||||||
|
}else{
|
||||||
|
_backGroundImage->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
||||||
|
}
|
||||||
|
|
||||||
if (able) {
|
if (able) {
|
||||||
_backGroundImage->setPreferredSize(_contentSize);
|
_backGroundImage->setPreferredSize(_contentSize);
|
||||||
}
|
}
|
||||||
|
@ -580,7 +584,11 @@ void Layout::setBackGroundImage(const std::string& fileName,TextureResType texTy
|
||||||
if (_backGroundImage == nullptr)
|
if (_backGroundImage == nullptr)
|
||||||
{
|
{
|
||||||
addBackGroundImage();
|
addBackGroundImage();
|
||||||
_backGroundImage->setScale9Enabled(_backGroundScale9Enabled);
|
if(_backGroundScale9Enabled){
|
||||||
|
_backGroundImage->setRenderingType(Scale9Sprite::RenderingType::SLICE);
|
||||||
|
}else{
|
||||||
|
_backGroundImage->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_backGroundImageFileName = fileName;
|
_backGroundImageFileName = fileName;
|
||||||
_bgImageTexType = texType;
|
_bgImageTexType = texType;
|
||||||
|
@ -656,7 +664,7 @@ void Layout::supplyTheLayoutParameterLackToChild(Widget *child)
|
||||||
void Layout::addBackGroundImage()
|
void Layout::addBackGroundImage()
|
||||||
{
|
{
|
||||||
_backGroundImage = Scale9Sprite::create();
|
_backGroundImage = Scale9Sprite::create();
|
||||||
_backGroundImage->setScale9Enabled(false);
|
_backGroundImage->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
||||||
|
|
||||||
addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);
|
addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue