-
Notifications
You must be signed in to change notification settings - Fork 905
Asynchronous loading texture #3350
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
Conversation
if ( this._listeners === undefined ) | ||
return; | ||
|
||
var listeners = this._listeners; | ||
var listenerArray = listeners[ type ]; | ||
if (!listenerArray) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to do this, you are checking it in the next if
Each interface for replace texture need to judge the state of loaded The listener will call the function again after the completion of loading. |
@@ -257,7 +257,19 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit | |||
_getPreferredHeight: function () { | |||
return this._preferredSize.height; | |||
}, | |||
|
|||
_asyncSetPreferredSize: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uniform update after successful loading
Something strange with sprite positions if some non-trivial transformations are applied to them(for example with composition from parent's transform) |
I don't understand, what do you mean by compositing parent transform ? |
I found example when anchor point is ignored:
In this example center of |
Thanks @1scaR1 Before the default value is set in the initTexture... The default value should be set within the ctor... |
CCEventHelper
CCSprite
Menu/Scale9Sprite/Button asynchronous loading texture