This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Domino: View { | |
var body: some View { | |
return Rectangle() | |
.fill(Color.clear) | |
.frame(width: 48, height: 96, alignment: .center) | |
.background( | |
VStack { | |
Image("Image-0") | |
.resizable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DominoWrapper: View { | |
@State var dragOffset = CGSize.zero | |
@State var accumulated = CGSize.zero | |
@State var rotateAngle:Double = 0 | |
var body: some View { | |
return ZStack { | |
Domino() | |
.rotationEffect(.degrees(self.rotateAngle), anchor: .center) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
var body: some View { | |
let screenSize = UIScreen.main.bounds | |
let screenWidth = screenSize.width | |
let screenHeight = screenSize.height | |
return ScrollView(Axis.Set.horizontal, showsIndicators: true) { | |
VStack { | |
ZStack { | |
Rectangle() | |
.fill(Color.yellow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Back: View { | |
var body: some View { | |
Rectangle() | |
.fill(Color.clear) | |
.frame(width: 48, height: 96, alignment: .center) | |
.background( | |
VStack{ | |
Image("Image-Back") | |
.resizable() | |
.frame(width: 32, height: 32, alignment: .top) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DominoWrapper: View { | |
@State var dragOffset = CGSize.zero | |
@State var accumulated = CGSize.zero | |
@State var rotateAngle:Double = 0 | |
@State var highImage:String | |
@State var lowImage:String | |
@State var hideBack = false | |
@State var spin:Double = 0 | |
@State var xpin:Double = -180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func allocateImagesV() -> [newView] { | |
var primaryImages:Set<String> = [] | |
var secondaryImages:Set<String> = [] | |
var tiles:Set<String> = [] | |
for _ in 0..<2 { | |
for build in 2..<16 { | |
primaryImages.insert(String(format: "Image-%d",build)) | |
secondaryImages.insert(String(format: "Image-%d",build)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func allocateImagesV() -> [newView] { | |
var primaryImages:Set<String> = [] | |
var secondaryImages:Set<String> = [] | |
var tiles:Set<String> = [] | |
for _ in 0..<2 { | |
for build in 2..<16 { | |
primaryImages.insert(String(format: "Image-%d",build)) | |
secondaryImages.insert(String(format: "Image-%d",build)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@ObservedObject var novelleViews = newViews() | |
@State var disableScrollView = false | |
@State var fudge = 0 | |
@State var fudgeOffset = CGSize.zero | |
@State var accumulated = CGSize.zero | |
@State private var rect:[CGRect] = [] | |
@State private var tiles:Int = 0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DoDomino: View { | |
@State var dragOffset = CGSize.zero | |
@State var accumulated = CGSize.zero | |
@State var rotateAngle:Double = 0 | |
@State var highImage:String | |
@State var lowImage:String | |
var body: some View { | |
Domino(highImage: $highImage, lowImage: $lowImage) | |
.border(Color.black) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DoDomino: View { | |
@State var column:Int | |
@State var dragOffset = CGSize.zero | |
@State var accumulated = CGSize.zero | |
@State var rotateAngle:Double = 0 | |
@State var highImage:String | |
@State var lowImage:String | |
@State var flipper:Double = 0 | |
var body: some View { |