Conflicts: DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxprojpull/13/head
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "doushouqi-lion 1.png",
|
||||
"filename" : "title-background.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Vs_Red.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "doushouqi-semilion.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 50 KiB |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "-16-05-2024.svg",
|
||||
"filename" : "title-background.svg",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,26 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ButtonView: View {
|
||||
var button1Title: String
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Button(action: {
|
||||
print("\(button1Title) pressé!")
|
||||
}) {
|
||||
Text(button1Title)
|
||||
.frame(width: 200)
|
||||
.padding()
|
||||
.background(Color.red)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ButtonsViewPreviews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ButtonView(button1Title: "Button")
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// MainButton.swift
|
||||
// DouShouQi_App
|
||||
//
|
||||
// Created by etudiant on 16/05/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MainButton: View {
|
||||
var body: some View {
|
||||
Button(action: {
|
||||
// Code à exécuter lorsque l'utilisateur appuie sur le bouton
|
||||
print("Bouton appuyé !")
|
||||
}) {
|
||||
// Label pour le bouton (par exemple, du texte ou une icône)
|
||||
Text("Appuyez ici")
|
||||
.padding() // Ajoute un peu d'espace autour du texte
|
||||
.background(Color.blue) // Couleur de fond du bouton
|
||||
.foregroundColor(.white) // Couleur du texte
|
||||
.cornerRadius(10) // Coins arrondis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MainButton_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
MainButton()
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
//
|
||||
// SelectPlayerButtonView.swift
|
||||
// DouShouQi_App
|
||||
//
|
||||
// Created by etudiant on 23/05/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct CustomShapeLeftButton: Shape {
|
||||
func path(in rect: CGRect) -> Path {
|
||||
var path = Path()
|
||||
path.move(to: CGPoint(x: rect.minX, y: rect.minY)) // coin supérieur gauche
|
||||
path.addLine(to: CGPoint(x: rect.maxX - 60, y: rect.minY)) // un peu avant le coin supérieur droit
|
||||
path.addLine(to: CGPoint(x: rect.maxX, y: rect.minY + 60)) // un peu en dessous du coin supérieur droit
|
||||
path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY)) // coin inférieur droit
|
||||
path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY)) // coin inférieur gauche
|
||||
path.closeSubpath()
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
struct CustomShapeRightButton: Shape {
|
||||
func path(in rect: CGRect) -> Path {
|
||||
var path = Path()
|
||||
path.move(to: CGPoint(x: rect.minX + 60, y: rect.minY)) // un peu à droite du coin supérieur gauche
|
||||
path.addLine(to: CGPoint(x: rect.maxX, y: rect.minY)) // coin supérieur droit
|
||||
path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY)) // coin inférieur droit
|
||||
path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY)) // coin inférieur gauche
|
||||
path.addLine(to: CGPoint(x: rect.minX, y: rect.minY + 60)) // un peu en dessous du coin supérieur gauche
|
||||
path.closeSubpath()
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct SelectPlayerButtonView: View {
|
||||
var player1:String = "IA"
|
||||
var player2:String = "IA"
|
||||
var body: some View {
|
||||
ZStack{
|
||||
Image("vs-custom")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 100, height: 100)
|
||||
.offset(y: -60)
|
||||
HStack{
|
||||
VStack (alignment: .leading) {
|
||||
Text(player1)
|
||||
.font(.title)
|
||||
.padding(3)
|
||||
Button(action: {
|
||||
print("Button j1 pressé!")
|
||||
}) {
|
||||
VStack {
|
||||
Text("+")
|
||||
.font(.largeTitle)
|
||||
.bold()
|
||||
Text("Add a player")
|
||||
.font(.body)
|
||||
.bold()
|
||||
}
|
||||
.frame(width: 150, height: 150)
|
||||
.padding()
|
||||
.border(/*@START_MENU_TOKEN@*/Color.black/*@END_MENU_TOKEN@*/, width: 4)
|
||||
.foregroundColor(.black)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
.clipShape(CustomShapeLeftButton())
|
||||
}
|
||||
}
|
||||
VStack (alignment: .trailing) {
|
||||
Text(player2)
|
||||
.font(.title)
|
||||
.padding(3)
|
||||
|
||||
Button(action: {
|
||||
print("Button j2 pressé!")
|
||||
}) {
|
||||
VStack {
|
||||
Text("+")
|
||||
.font(.largeTitle)
|
||||
.bold()
|
||||
Text("Add a player")
|
||||
.font(.body)
|
||||
.bold()
|
||||
} .frame(width: 150, height: 150)
|
||||
.padding()
|
||||
.foregroundColor(.black)
|
||||
.border(/*@START_MENU_TOKEN@*/Color.black/*@END_MENU_TOKEN@*/, width: 4)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
.clipShape(CustomShapeRightButton())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
SelectPlayerButtonView()
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
//
|
||||
// SelectPlayerView.swift
|
||||
// DouShouQi_App
|
||||
//
|
||||
// Created by nathan on 23/05/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SelectPlayerView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
ZStack {
|
||||
Image("title-background")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 250, height: 250)
|
||||
|
||||
Text("Select Your Player")
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(.black)
|
||||
.bold()
|
||||
}
|
||||
|
||||
SelectPlayerButtonView()
|
||||
|
||||
Spacer()
|
||||
HStack {
|
||||
Spacer()
|
||||
VStack(alignment: .trailing)
|
||||
{
|
||||
ButtonView(button1Title: "Start")
|
||||
ButtonView(button1Title: "Setting")
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SelectPlayerViewPreviews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SelectPlayerView()
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 18 KiB |