File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed
Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,21 @@ import SwiftUI
1010import SpriteKit
1111
1212struct GameView : View {
13+
14+ @State var menuView : Bool = false
15+
1316 var body : some View {
14- ZStack {
15- SpriteKitInterface ( scene: HistoryScene ( level: " Reverse " ) )
16- Button ( action: { NSApplication . shared. terminate ( self ) } , label: { Image ( systemName: " xmark " ) } )
17- . buttonStyle ( PlainButtonStyle ( ) )
18- . imageScale ( . large)
19- . foregroundColor ( . red)
20- . position ( x: 30 , y: 30 )
17+ if menuView {
18+ MenuView ( )
19+ } else {
20+ ZStack {
21+ SpriteKitInterface ( scene: HistoryScene ( level: " Reverse " ) )
22+ Button ( action: { menuView. self. toggle ( ) } , label: { Image ( systemName: " xmark " ) } )
23+ . buttonStyle ( PlainButtonStyle ( ) )
24+ . imageScale ( . large)
25+ . foregroundColor ( . red)
26+ . position ( x: 30 , y: 30 )
27+ }
2128 }
2229 }
2330}
Original file line number Diff line number Diff line change @@ -21,8 +21,19 @@ struct OptionView: View {
2121 NavigationView {
2222 HStack {
2323 List {
24- Button ( action: { self . menuView. toggle ( ) } , label: { Text ( " << Menu " ) } ) . buttonStyle ( PlainButtonStyle ( ) )
24+
25+ Button ( action: {
26+ self . menuView. toggle ( )
27+
28+ } , label: {
29+ Image ( systemName: " chevron.left.2 " )
30+ Text ( " Return " )
31+ } )
32+ . buttonStyle ( PlainButtonStyle ( ) )
33+ . foregroundColor ( . red)
34+
2535 NavigationLink ( destination: KeysView ( ) , label: { Text ( " Keys " ) } )
36+
2637 } . listStyle ( SidebarListStyle ( ) )
2738 . font ( . largeTitle)
2839 }
You can’t perform that action at this time.
0 commit comments