Skip to content

Commit

Permalink
デザインの背景変更
Browse files Browse the repository at this point in the history
あとで試してー
  • Loading branch information
hypebeans committed Oct 19, 2023
1 parent c79bc24 commit 3fbd0fc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
Binary file not shown.
31 changes: 19 additions & 12 deletions PumpkinSmash/HowToPlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ struct HowToPlayView: View {
.foregroundStyle(.white)
.padding()
Spacer()
HStack {
Image("PlayMethod")
.resizable()
.aspectRatio(contentMode: .fit)
.scaleEffect(0.65)
Image("Instruction")
.resizable()
.aspectRatio(contentMode: .fit)
.scaleEffect(1.15)
.offset(x: -20)
.frame(maxWidth: .infinity)
}.padding()
Spacer()
HStack(spacing: 0) {
Text("3つの難易度は")
.font(.custom("Kiwi Maru", size: 16))
Expand Down Expand Up @@ -323,24 +336,18 @@ struct HowToPlayView: View {
Text("難しい")
.font(.custom("Kiwi Maru", size: 24))
.foregroundStyle(Color("FourthColor"))
}


HStack {
Image("PlayMethod")
.resizable()
.aspectRatio(contentMode: .fit)
.scaleEffect(0.75)
Image("Instruction")
.resizable()
.aspectRatio(contentMode: .fit)
}.padding()

}
}
}
// .navigationViewStyle(StackNavigationViewStyle())

.ignoresSafeArea()
// .presentationDetents([
// .large
// ])
// .presentationBackgroundInteraction(.enabled(upThrough: .height(.infinity)))




Expand Down
16 changes: 16 additions & 0 deletions PumpkinSmash/LevelSelectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct LevelSelectView: View {
// difficulty → 難易度 0: 簡単, 1: 普通 2: 難しい
// presentedで代入される
@State var difficulty: Int = 0
@Environment(\.presentationMode) var present

var body: some View {
NavigationStack(path: $path) {
Expand Down Expand Up @@ -98,6 +99,17 @@ struct LevelSelectView: View {
}
.navigationDestination(for: ViewPath.self) { value in
GameFieldView(difficulty: difficulty)
// .navigationBarBackButtonHidden(true)
// .navigationBarItems(leading:
// Button(action: goBack) {
// HStack {
// Image("backButton")
// .resizable()
// .aspectRatio(contentMode: .fit)
// }
// }
// )

}
}
}
Expand All @@ -108,6 +120,10 @@ struct LevelSelectView: View {
difficulty = num
path.append(.LevelSelectView)
}

// func goBack() {
// self.present.wrappedValue.dismiss()
// }
}

struct LevelSelectView_Previews: PreviewProvider {
Expand Down
8 changes: 6 additions & 2 deletions PumpkinSmash/TitleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SwiftUI
struct TitleView: View {
// 画面遷移を制御
@State var path: [ViewPath] = []
@State var showPlay = false

var body: some View {
NavigationStack(path: $path) {
Expand All @@ -20,7 +21,7 @@ struct TitleView: View {
HStack {
// 遊び方ボタン
Button(action: {
// path.append()
showPlay = true
}) {
Image(systemName: "info.circle.fill")
.foregroundColor(Color("FourthColor"))
Expand All @@ -34,7 +35,10 @@ struct TitleView: View {

}
.padding()

.sheet(isPresented: $showPlay) {
HowToPlayView()
}

// ロゴ
Image("Logo")
.resizable()
Expand Down

0 comments on commit 3fbd0fc

Please sign in to comment.