We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop() function doesn't have an effect
stop()
import Foundation import Macaw class StudioView: MacawView { required init?(coder aDecoder: NSCoder) { super.init(node: Group(contents: []), coder: aDecoder) let rect = Rect( w: 50.0, h: 50.0 ) let soundBase = Shape( form: rect, fill: Color.red ) soundBase.place = Transform.move(dx: Double(self.bounds.width) / 2.0 - 25, dy: Double(self.bounds.height) / 2.0 - 25) let text = Text( text: "START", align: .mid, place: Transform.move( dx: (Double(self.bounds.width) / 2), dy: (Double(self.bounds.height) / 2) ), opaque: false ) var animation: Animation! var count: Int = 0 soundBase.onTap { _ in if count % 2 == 0 { animation = Array(0...10).map { index in return [ soundBase.opacityVar.animation(to: 1.0, during: 0.1), soundBase.opacityVar.animation(to: 0.0, during: 0.1) ].sequence().delay(Double(index)) }.combine() text.text = "STOP!" print("START!") animation.play() } else { print("STOP!") text.text = "START!" animation.stop() } count = count + 1 } self.node = [soundBase, text].group() } }
The text was updated successfully, but these errors were encountered:
vhailor13
No branches or pull requests
stop()
function doesn't have an effectThe text was updated successfully, but these errors were encountered: