{"id":20854305,"url":"https://github.com/sanderfrenken/morespritekit","last_synced_at":"2025-04-13T04:04:58.882Z","repository":{"id":41405847,"uuid":"185072538","full_name":"sanderfrenken/MoreSpriteKit","owner":"sanderfrenken","description":"👾 Sprite Kit extensions 👾","archived":false,"fork":false,"pushed_at":"2025-02-12T20:15:49.000Z","size":3059,"stargazers_count":64,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T04:04:41.680Z","etag":null,"topics":["game-development","ios","spritekit","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanderfrenken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-05T19:18:28.000Z","updated_at":"2025-03-21T19:52:04.000Z","dependencies_parsed_at":"2023-01-23T05:01:27.024Z","dependency_job_id":"fb06c849-9310-4675-a34b-d5b3970cb460","html_url":"https://github.com/sanderfrenken/MoreSpriteKit","commit_stats":{"total_commits":105,"total_committers":2,"mean_commits":52.5,"dds":0.4285714285714286,"last_synced_commit":"b6554a5c331cb0ef349f31543f0d4c21a949e2dd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderfrenken%2FMoreSpriteKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderfrenken%2FMoreSpriteKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderfrenken%2FMoreSpriteKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanderfrenken%2FMoreSpriteKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanderfrenken","download_url":"https://codeload.github.com/sanderfrenken/MoreSpriteKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661707,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-development","ios","spritekit","swift"],"created_at":"2024-11-18T03:25:15.382Z","updated_at":"2025-04-13T04:04:58.853Z","avatar_url":"https://github.com/sanderfrenken.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)\n![Platform support](https://img.shields.io/badge/platform-ios-lightgrey.svg?style=flat-square)\n\n# MoreSpriteKit\n\nThis package offers additional node types and effects which you can use in combination with [SpriteKit](https://developer.apple.com/spritekit/). In addition it provides extensions to make complicated tasks a bit easier and improve the readability of your code.\n\nAll sources are written in Swift.\n\n## Example usage\n\nFor examples using `MoreSpriteKit`, please refer to the demo project [MoreSpriteKitDemo](https://github.com/sanderfrenken/MoreSpriteKitDemo)\n\n### MSKAnimatedLabel\n\n`SKNode` that draws specified text over multiple lines, separated per `newLine` character.\nThe text typing can also be animated, meaning each character will be added after a specified interval, creating a typewriter effect.\n\nUse public initializer:\n\n```Swift\npublic init(text: String,\n            horizontalAlignment: SKLabelHorizontalAlignmentMode = .center,\n            durationPerCharacter: Double = 0.05,\n            fontSize: CGFloat = 12,\n            marginVertical: CGFloat = 15.0,\n            fontColor: SKColor = .white,\n            fontName: String = \"Chalkduster\",\n            skipSpaces: Bool = true\n            labelWidth: CGFloat = 0.0\n            finishTypingOnTouch: Bool = false)\n```\nWhere the text can be separated by new line characters to indicate start of new line.\nSpecify a specific `labelWidth` to wrap all text to a specific width. `MSKAnimatedLabel` will create new lines where necessary.\nWhen the specified `labelWidth` is to small for a certain CharacterSequence, a fatal error is thrown.\n\nWhen `durationPerCharacter \u003c= 0.0`, all lines will be drawn immediately without any animation.\nWhen `finishTypingOnTouch equals true`, all remaining lines will be drawn instantly without any animation when a user taps the label.\n\n![Preview](/Previews/animated-label.gif)\n\n### MSKEmitterLabel\n\n`SKNode` that draws specified text using an emitter that follows the characters outlines, over a given duration.\n\nUse public initializer:\n\n```Swift\npublic init(text: String,\n            font: UIFont,\n            emitterName: String,\n            marginHorizontal: CGFloat = 10.0,\n            animationDuration: Double = 2.0,\n            addEmitterInterval: Double = 0.1)\n```\n\n\n![Preview](/Previews/emitter-label.gif)\n\n### SKAction+Spiral\n\nExtension on SKAction allowing to create a spiraling movement.\nUsage:\n\n```Swift\nSKAction.spiral(startRadius: radius,\n                endRadius: radius-50,\n                totalAngle: CGFloat(.pi * 2.0),\n                centerPoint: .zero,\n                duration: 1.5)\n```\n![Preview](/Previews/spiral-action.gif)\n\n### SKAction+Shake\n\nExtension on `SKAction` allowing to create a shake effect.\n*NB preview as GIF is not very useful, for proper demonstration please see the example application.*\n\nUsage:\n\n```Swift\nSKAction.shake(shakeDuration: 0.2,\n               intensity: arc4random_uniform(40)+10,\n               duration: 3)\n```\n![Preview](/Previews/shake-action.gif)\n\n\n### SKShapeNode+Arrow\nExtension on `SKShapeNode` allowing to create a node with an arrow shape.\nUsage:\n\n```Swift\nlet arrow = SKShapeNode(arrowWithFillColor: randomColor,\n                        strokeColor: randomColor,\n                        lineWidth: 4,\n                        length: 100,\n                        tailWidth: 20,\n                        headWidth: 50,\n                        headLength: 30)\n```\n![Preview](/Previews/skshapenode-arrow.png)\n\n### SKTexture+RadialGradient\nExtension on `SKTexture` allowing to create a texture with a radial gradiant. Could be used for example for range nodes, indicating a creatures attack range.\nUsage:\n\n```Swift\nlet radialGradientSize = CGSize(width: 150, height: 150)\nlet radialGradientColors = [UIColor.red, UIColor.blue, UIColor.green, UIColor.blue, UIColor.orange]\nlet radialGradientLocations: [CGFloat] = [0, 0.25, 0.45, 0.65, 1.0]\n\nlet radialTexture = SKTexture(radialGradientWithColors: radialGradientColors,\n                              locations: radialGradientLocations,\n                              size: radialGradientSize)\n\nlet radialNode = SKSpriteNode(texture: radialTexture)\n```\n![Preview](/Previews/sktexture-gradient.png)\n\n### SKTexture+LinearGradient\nExtension on `SKTexture` allowing to create a texture with a linear gradiant. Could be used for example for a healthbar.\nUsage:\n\n```Swift\nlet linearGradientSize = CGSize(width: 150, height: 30)\nlet linearGradientColors: [UIColor] = [.red, .yellow, .green, .yellow, .red]\nlet linearGradientLocations: [CGFloat] = [0, 0.35, 0.5, 0.65, 1.0]\n\nlet linearGradientTexture = SKTexture(linearGradientWithColors: linearGradientColors,\n                                      locations: linearGradientLocations,\n                                      size: linearGradientSize)\n\nlet gradientNode = SKSpriteNode(texture: linearGradientTexture)\n```\n![Preview](/Previews/sktexture-linearGradient.png)\n\n\n### SKAction+TimingMode and Array+SKAction\n- Public extensions on `SKAction` to add a `timingMode` or for example a `repeatForever` inline.\n- Public extensions on `Array` to convert it inline to a `SKAction.group` or `SKAction.sequence`.\n\nUsage:\n```\nlet actions: [SKAction] = [.run { self.addEmitterLabel() }, .wait(forDuration: 10)]\nrun(actions.sequence().forever())\n```\n\n### Requirements\n\n- iOS 10.3+\n- Xcode 10.1+\n- Swift 5+\n\n### Installation\n\n#### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding MoreSpriteKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/sanderfrenken/MoreSpriteKit\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n#### Manually\n\nIf you prefer not to use any of the aforementioned dependency managers you can integrate the desired sources in your project manually, by adding the corresponding Swift files to your project.\n\n### SwiftLint\n\nWe use Swiftlint from [Realm](https://realm.io/) to lint our code.\nMore info can be found on [SwiftLint](https://github.com/realm/SwiftLint).\nDetails about the specific settings for this project can be found in the `.swiftlint.yml` file.\n\n### Other information\n\n- If you think that something is missing or would like to propose new feature, please create an issue.\n- Please feel free to ⭐️ the project. This gives confidence that you like it which stimulates further development and support 🤩\n\n### Games using MoreSpriteKit\nThe following games are using MoreSpriteKit:\n\n- [Battledom](https://sanderfrenken.github.io/battledom-site/)\n- [Herodom](https://sites.google.com/view/herodom/home)\n- [Numbed](https://apps.apple.com/nl/app/numbed/id841975891)\n- [Connexx](https://apps.apple.com/nl/app/connexx/id1198001137)\n- [SlippySlide](https://apps.apple.com/nl/app/slippy-slide/id911034356)\n\n- Do you use MoreSpriteKit in any of your applications? Please extend this list by making a PR!\n\n### License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderfrenken%2Fmorespritekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanderfrenken%2Fmorespritekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanderfrenken%2Fmorespritekit/lists"}