|
|
@ -1,9 +1,13 @@ |
|
|
|
import tkinter as tk |
|
|
|
from tkinter import messagebox |
|
|
|
|
|
|
|
from random import choice, randint |
|
|
|
from PIL import Image |
|
|
|
|
|
|
|
|
|
|
|
pique = "๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ" |
|
|
|
coeur = '๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ' |
|
|
|
carreau = "๐๐๐๐๐
๐๐๐๐๐๐๐๐๐" |
|
|
|
trefle = "๐๐๐๐๐๐๐๐๐๐๐๐๐๐" |
|
|
|
cartes = pique + coeur + carreau + trefle |
|
|
|
|
|
|
|
class Interface(tk.Frame): |
|
|
|
def __init__(self, master): |
|
|
@ -12,15 +16,21 @@ class Interface(tk.Frame): |
|
|
|
self.grid(row=0) |
|
|
|
#revoir le design |
|
|
|
self.menu = tk.Frame() |
|
|
|
title = tk.Label(self.menu, text="Bataille",font=("eufm10", 42)) |
|
|
|
title.grid(row=0) |
|
|
|
|
|
|
|
#image ne fonctionne pas |
|
|
|
canvas= tk.Canvas(self.menu, width= 300, height=300) |
|
|
|
image = tk.PhotoImage(file='title_img.gif') |
|
|
|
canvas.create_image(50, 10, image=image) |
|
|
|
canvas.grid(row=2) |
|
|
|
C = tk.Canvas (self.menu, bg="black",height=250, width=300) |
|
|
|
coord = 10, 50, 240, 210 |
|
|
|
C.grid(row=0) |
|
|
|
|
|
|
|
#image ne fonctionne pas |
|
|
|
#canvas= tk.Canvas(self.menu, width= 300, height=300) |
|
|
|
#image = tk.PhotoImage(file='title_img.png') |
|
|
|
#canvas.create_image(50, 10, image=image) |
|
|
|
#canvas.grid(row=2) |
|
|
|
for i in range(20): |
|
|
|
C.create_text(randint(0,300),randint(0,250),fill="white",font="Times 20 italic bold",text=choice(cartes)) |
|
|
|
|
|
|
|
titre = tk.Label(self.menu, text="Bataille",bg="grey", fg="white",font=("eufm10", 42)) |
|
|
|
titre.grid(row=0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -42,7 +52,7 @@ class Interface(tk.Frame): |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
root = tk.Tk() |
|
|
|
root.title("Hello World!") |
|
|
|
root.title("Bataille") |
|
|
|
root.geometry("300x300") |
|
|
|
hello_frame = Interface(root) |
|
|
|
hello_frame.mainloop() |
|
|
|