Skip to content
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

[iOS] update Swift inteface for more fine grained control(like external atlas loading) #2772

Open
wants to merge 3 commits into
base: 4.2
Choose a base branch
from

Conversation

pbk20191
Copy link
Contributor

@pbk20191 pbk20191 commented Mar 2, 2025

  • move instance method to static method which does not require spine cpp pointer

  • implement equality and hashing based on cpp pointer so that it can be stored in collection and compare it

  • expose Atlas image count property so that the user can load the atlas resource lazily

  • User can now Create Atlas by using Altas static function, and fetch whole resource path by iterating count of atlas page count

let atlas = Atlas.load(atlasData:"atlas txt file content string!")
if let error = atlas.error {
    throw SpineError(error)
}
let count = Int(atlas.imagePathCount)
let atlasImagePaths:[String] = (0..<count).map{ atlas.getImagePath(index: Int32($0))! }

// load the desired png only when needed maybe?

pbk20191 added 2 commits March 2, 2025 18:37
- move instance method to static method which does not require spine cpp pointer
- implement equality and hashing based on cpp pointer so that it can be stored in collection and compare it
- expose Atlas image count property so that the user can load the atlas resource lazily

- User can now Create Atlas by using Altas static function, and fetch whole resource path by iterating count of atlas page count
@pbk20191 pbk20191 changed the title update Swift inteface for more fine grained control(like external atlas loading) [iOS] update Swift inteface for more fine grained control(like external atlas loading) Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant