samedi 9 janvier 2016

How do you change the color of all of the nodes of a specific name in SpriteKit with Swift

Vote count: 0

I'm trying to change the color of every single instance of a node in SpriteKit. When I try to put it in the update method, it only changes one and not all of them.

override func update(currentTime: CFTimeInterval) {
    if changeColor == true{

        self.enumerateChildNodesWithName("blocks", usingBlock: {
            node, stop in
            block?.color = UIColor.orangeColor()
        })

    }
}

asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



How do you change the color of all of the nodes of a specific name in SpriteKit with Swift

Aucun commentaire:

Enregistrer un commentaire