-
Notifications
You must be signed in to change notification settings - Fork 0
/
coordonée.py
26 lines (23 loc) · 966 Bytes
/
coordonée.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from main import *
class SaveButton(Button):
def __init__(self):
super().__init__(
parent=scene,
position=window.top_right + Vec2(-0.1, -0.1), # Position du bouton
scale=0.075,
text='9', # Numéro du bouton
on_click=self.save_coordinates
)
self.coordinates = []
def save_coordinates(self):
self.coordinates = []
print("Enregistrement des coordonnées de tous les blocs :")
for entity in scene.entities:
if isinstance(entity, Voxel) or isinstance(entity, TreeVoxel):
self.coordinates.append(entity.position)
print("Bloc à la position :", entity.position)
print("Block a la position :", self.position)
def on_save_button_click(self):
print("Coordonnées de tous les blocs :")
for coordinate in self.coordinates:
print("Bloc à la position :", coordinate)