Tuesday, June 30, 2026
HomeiOS Developmentios - SKAction on a bunch of SKSpriteNodes from the identical origin

ios – SKAction on a bunch of SKSpriteNodes from the identical origin

[ad_1]

I’ve an SKSpriteNode, button. I’ve an SKAction on this, to pulse it out and in:

let pulseUp = SKAction.scale(to: 1.03, length: 0.3)
let pulseDown = SKAction.scale(to: 0.97, length: 0.3)
let pulse = SKAction.sequence([pulseUp, pulseDown])
let repeatPulse = SKAction.repeatForever(pulse)
button.run(repeatPulse)

The button has a dynamic “Excessive Rating” counter on it (see picture). That is populated by including new SKSpriteNodes, for every quantity.

I realise, that I have to pulse these quantity nodes too, so it seems to be like they’re built-in to the button and the entire group of nodes strikes in sync.

If I simply add the identical pulse motion to the numbers, they clearly simply pulse from their origin, so it does not appear like they’re linked to the button. How can I get a bunch of nodes to all pulse collectively?

enter image description here

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments