void UIButtonMetadata::SetAlign(int value)
{
    if (!VerifyActiveParamID())
    {
        return;
    }
    
    UIControlBackground* background = GetActiveUIButton()->GetStateBackground(this->uiControlState);
    if (!background)
    {
        return;
    }
    
    background->SetAlign(value);
    UpdatePropertyDirtyFlagForAlign();
}
void UIButtonMetadata::SetColorInheritType(int value)
{
    if (!VerifyActiveParamID())
    {
        return;
    }
    
    UIControlBackground* background = GetActiveUIButton()->GetStateBackground(this->uiControlState);
    if (!background)
    {
        return;
    }

    background->SetColorInheritType((UIControlBackground::eColorInheritType)value);
    UpdatePropertyDirtyFlagForColorInheritType();
}
Пример #3
0
	UIControlBackground *UIButton::CreateBackForState(eButtonDrawState buttonState)
	{
		if(stateBacks[buttonState])
		{
			return stateBacks[buttonState];
		}
		
		UIControlBackground* targetBack = stateBacks[BackgroundIndexForState(buttonState)];
		if(!targetBack)
		{
			stateBacks[buttonState] = new UIControlBackground();
		}
		else
		{
			stateBacks[buttonState] = targetBack->Clone();
		}
		return stateBacks[buttonState];
	}
Пример #4
0
void UIButtonMetadata::SetSpriteModification(int value)
{
	if (!VerifyActiveParamID())
	{
		return;
	}

	for (uint32 i = 0; i < GetStatesCount(); ++i)
	{
		UIControlBackground* background = GetActiveUIButton()->GetStateBackground(uiControlStates[i]);
		if (!background)
		{
			continue;
		}

		background->SetModification(value);
	}
	UpdatePropertyDirtyFlagForSpriteModification();
}
Пример #5
0
void UIButtonMetadata::SetColorInheritType(int value)
{
    if (!VerifyActiveParamID())
    {
        return;
    }

	for (uint32 i = 0; i < this->GetStatesCount(); ++i)
	{
		UIControlBackground* background = GetActiveUIButton()->GetStateBackground(this->uiControlStates[i]);
		if (!background)
		{
			continue;
		}

		background->SetColorInheritType((UIControlBackground::eColorInheritType)value);
	}
    UpdatePropertyDirtyFlagForColorInheritType();
}
Пример #6
0
UIControlBackground *UIControlBackground::Clone()
{
	UIControlBackground *cb = new UIControlBackground();
	cb->CopyDataFrom(this);
	return cb;
}