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
import Foundation import Macaw class StudioView: MacawView { required init?(coder aDecoder: NSCoder) { super.init(node: Group(contents: []), coder: aDecoder) let animationGroup = Group(contents: []) let animation = animationGroup.contentsVar.animation({ t in let shape = Shape( form: Arc( ellipse: Ellipse( cx: (Double(self.bounds.width) / 2), cy: (Double(self.bounds.height) / 2), rx: 150.0, ry: 150.0), shift: 0, extent: 2 * M_PI * t ), stroke: Stroke(fill: Color.red, width: 4) ) return [shape] }) let playBtn = Shape( form: Rect( x: Double(self.bounds.width) / 2 - 50, y: Double(self.bounds.height) / 2 - 50, w: 100, h: 100 ), fill: Color.red ) 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 count: Int = 0 playBtn.onTap { _ in if count % 2 == 0 { count = count + 1 print("START!") animation.play() } else { print("STOP!") animation.stop() } } self.node = [playBtn, text, animationGroup].group() } }
The text was updated successfully, but these errors were encountered:
93351e4
vhailor13
No branches or pull requests
The text was updated successfully, but these errors were encountered: