Skip to content

More adaptive ccui.Button API #3376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions extensions/ccui/uiwidgets/UIButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ ccui.Button = ccui.Widget.extend(/** @lends ccui.Button# */{
break;
case ccui.Widget.PLIST_TEXTURE:
//SetTexture cannot load resource
if (normal[0] === "#") {
normal = normal.substr(1, normal.length - 1);
}
normalRenderer.initWithSpriteFrameName(normal);
break;
default:
Expand Down Expand Up @@ -302,6 +305,9 @@ ccui.Button = ccui.Widget.extend(/** @lends ccui.Button# */{
break;
case ccui.Widget.PLIST_TEXTURE:
//SetTexture cannot load resource
if (selected[0] === "#") {
selected = selected.substr(1, selected.length - 1);
}
clickedRenderer.initWithSpriteFrameName(selected);
break;
default:
Expand Down Expand Up @@ -347,6 +353,9 @@ ccui.Button = ccui.Widget.extend(/** @lends ccui.Button# */{
break;
case ccui.Widget.PLIST_TEXTURE:
//SetTexture cannot load resource
if (disabled[0] === "#") {
disabled = disabled.substr(1, disabled.length - 1);
}
disabledRenderer.initWithSpriteFrameName(disabled);
break;
default:
Expand Down