-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feat: refactor spine loader & add ability for dynamic skin change #112
base: dev/4.2
Are you sure you want to change the base?
Conversation
Support premultipliedAlpha
src/loader/LoaderUtils.ts
Outdated
skeletonRawData = data; | ||
} | ||
} catch { | ||
// origin asset |
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.
If there is an exception, return null to let the caller be aware.
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.
done
src/loader/LoaderUtils.ts
Outdated
} | ||
} catch { | ||
// origin asset | ||
} |
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.
If there is an exception, return null to let the caller be aware.
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.
Using JSON.parse to determine whether atlasText is editor asset is the most straightforward approach.
If parsing fails, it indicates that the text is not JSON and is instead a none editor Spine atlas asset.
If the raw asset is invalid, an error will be thrown when creating a new TextureAtlas.
const header = this._bufferReader.nextStr(); | ||
isEditorAsset = header.startsWith('spine'); | ||
} catch {} // origin asset may exceed when call next str | ||
} |
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.
check is editor asset should be simpler?
What does this PR do?
Adjust spine basic API.
Related issue:
#110
Changes
Dynamic change examples: