Skip to content

Conversation

@jandujar
Copy link
Contributor

We need to change display of an animation by name for better usability

Jose Antonio added 2 commits November 12, 2013 02:47
update cocos2d-html5 develop from cocos2d:develop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,jandujar.
Thank you very much to your commit. That is a good idea to add this api .
I modify your code like:

    var decoDisplay, displayIndex;
    for (var i = 0; i < this._decoDisplayList.length; i++) {
        var locDecoDisplay = this._decoDisplayList[i];
        var locDisplay = locDecoDisplay.getDisplay();
        if ((typeof(locDisplay.getDisplayName) != "undefined") && name == locDisplay.getDisplayName()) {
            decoDisplay = locDecoDisplay;
            displayIndex = i;
            break;
        }
    }
    if (!decoDisplay) {) {
        return;
    }
    this._forceChangeDisplay = force;
    this._displayIndex = displayIndex;
    this.setCurrentDecorativeDisplay(decoDisplay);

@jandujar
Copy link
Contributor Author

ok xingsenma, feel free to modify and commit. ;)

@linshun linshun closed this Apr 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants