void UIButton::SetStateSprite(int32 state, Sprite *newSprite, int32 spriteFrame/* = 0*/) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i)->SetSprite(newSprite, spriteFrame); } state >>= 1; } }
void UIButton::CreateBackgroundForState(int32 state) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i); } state >>= 1; } }
void UIButton::SetStateColorInheritType(int32 state, UIControlBackground::eColorInheritType value) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i)->SetColorInheritType(value); } state >>= 1; } selectedBackground = GetActualBackground(controlState); }
void UIButton::SetStateColor(int32 state, Color color) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i)->SetColor(color); } state >>= 1; } selectedBackground = GetActualBackground(controlState); }
void UIButton::SetStateModification(int32 state, int32 modification) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i)->SetModification(modification); } state >>= 1; } selectedBackground = GetActualBackground(controlState); }
void UIButton::SetStateSprite(int32 state, const FilePath &spriteName, int32 spriteFrame/* = 0*/) { for(int i = 0; i < DRAW_STATE_COUNT; i++) { if(state & 0x01) { CreateBackForState((eButtonDrawState)i)->SetSprite(spriteName, spriteFrame); } state >>= 1; } selectedBackground = GetActualBackground(controlState); }