Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Repository files navigation

SpriteKit Utils - Buttons, Switches, Stacks and Collections for SpriteKit!

Easy to use SpriteKit controls

  • TWButton: A SKSpriteNode subclass that implements commom button funcionalities (similar to UIKit's UIButton).
  • TWSwitch: A SKSpriteNode subclass that implements commom switch funcionalities (similar to UIKit's UISwitch).
  • TWStack: A SKSpriteNode subclass that implements commom stack funcionalities (similar to UIKit's UIStackView).
  • TWCollection: A SKSpriteNode subclass that implements commom collection funcionalities (similar to UIKit's UICollectionView).

Demonstration

Here's a full init code snippet:

TWButton

letcolorButton=TWButton(
size:CGSize(width:102, height:40),
normal:.blue,
highlighted:.yellow,
disabled:.gray
)
colorButton.addClosure(.touchUpInside){[unowned self] _ in
// Action
}

TWSwitch

letcolorSwitch=TWSwitch(
size:CGSize(width:102, height:40),
normal:.blue,
highlighted:.yellow,
selected:.green,
disabled:.gray
)
colorSwitch.addClosure(.selectionChanged){[unowned self] _ in
// Action
}

TWStackNode

letstackNode=TWStackNode(
fillMode:.vertical,
sizingMode:.dynamic(spacing:8))

TWCollectionNode

letcollectionNode=TWCollectionNode(
fillMode:.init(
columnsCount:3,
lineSpacing:30,
elementSize:CGSize(width:100, height:100)))

License

See LICENSE for more information

About

TWControls - Simple Controls (Button, Switch) for SpriteKit, written in Swift!

Resources

Stars

53 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages