1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-14 01:48:49 +03:00
Macaw/Source/model/scene/Node.swift

53 lines
1.2 KiB
Swift
Raw Normal View History

2015-12-15 11:55:08 +03:00
import Foundation
2016-05-11 09:10:17 +03:00
import RxSwift
2015-12-15 11:55:08 +03:00
2016-08-03 09:54:54 +03:00
public class Node: Drawable {
2015-12-15 11:55:08 +03:00
2016-05-11 09:10:17 +03:00
public let posVar: Variable<Transform>
public var pos: Transform {
2016-05-11 09:10:17 +03:00
get { return posVar.value }
set(val) { posVar.value = val }
}
2016-05-11 09:10:17 +03:00
public let opaqueVar: Variable<NSObject>
public var opaque: NSObject {
2016-05-11 09:10:17 +03:00
get { return opaqueVar.value }
set(val) { opaqueVar.value = val }
}
2016-08-03 10:39:21 +03:00
public let opacityVar: Variable<Double>
public var opacity: Double {
get { return opacityVar.value }
set(val) { opacityVar.value = val }
}
2016-05-11 09:10:17 +03:00
public let clipVar: Variable<Locus?>
public var clip: Locus? {
2016-05-11 09:10:17 +03:00
get { return clipVar.value }
set(val) { clipVar.value = val }
}
2015-12-15 11:55:08 +03:00
2016-08-03 10:39:21 +03:00
public init(pos: Transform, opaque: NSObject = true, opacity: Double = 1, clip: Locus? = nil, visible: NSObject = true, tag: [String] = [], bounds: Rect? = nil) {
2016-08-03 09:54:54 +03:00
self.posVar = Variable<Transform>(pos)
self.opaqueVar = Variable<NSObject>(opaque)
2016-08-03 10:39:21 +03:00
self.opacityVar = Variable<Double>(opacity)
2016-08-03 09:54:54 +03:00
self.clipVar = Variable<Locus?>(clip)
2015-12-16 09:49:10 +03:00
super.init(
2016-08-03 10:39:21 +03:00
visible: visible,
tag: tag,
bounds: bounds
2015-12-16 09:49:10 +03:00
)
2015-12-15 11:55:08 +03:00
}
2015-12-20 14:47:07 +03:00
// GENERATED NOT
2016-02-04 18:42:09 +03:00
public func bounds() -> Rect? {
2015-12-20 17:06:11 +03:00
return Rect()
}
2015-12-15 11:55:08 +03:00
2016-08-03 10:39:21 +03:00
// GENERATED NOT
public override func mouse() -> Mouse {
return Mouse(pos: Point(), onEnter: Signal(), onExit: Signal(), onWheel: Signal())
}
2016-08-03 18:09:52 +03:00
}