I'm doing some experimentation with SpriteKit and am roadblocked on a concept that to me seems very simple. I'm trying to draw simple shape (ie: square, circle) to the screen.
var testNode = SKSpriteNode()
testNode = SKSpriteNode(color: UIColor.orangeColor(), size: CGSizeMake(20, 20))
testNode.position = goalPoint
testNode.color = UIColor.orangeColor()
self.addChild(testNode)
According to the developer documentation for SKSpriteNode
An SKSpriteNode is a node that draws a textured image, a colored square, or a textured image blended with a color. You can also provide a custom shader to create your own rendering effects.
Apparently I'm missing how to do the colored square. I was able to create an SKTexture and get a sprite to appear, but without one I've been unable to get geometric shapes to appear.
I also attempted to use the SKShapeNode
class but was unable to get that to appear either. I assume I'm missing something simple. Any suggestions?