Skip to content

Commit 1161334

Browse files
committed
Pieces can be Dragged by Mouse; MOUSE CANNOT TOUCH BUTTON - NEEDS FIXING
1 parent 96bfdc2 commit 1161334

File tree

3 files changed

+271
-258
lines changed

3 files changed

+271
-258
lines changed

Board.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
11
from kivy.uix.screenmanager import Screen
22
from kivy.core.window import Window
33
from kivy.app import App
4-
4+
from kivy.uix.widget import Widget
5+
from kivy.uix.scatter import Scatter
56
from position_of_mouse import find_position
7+
from kivy.uix.floatlayout import FloatLayout
68

7-
class board_setup(Screen):
8-
9-
def on_mouse_pos(self, pos):
10-
#This function gets the position of the mouse, in chessboard labels
11-
position = find_position()
12-
print(position.chess_position(pos))
13-
14-
15-
def touched(self, id):
16-
print(id)
17-
18-
19-
def release(self):
20-
print("RRR")
21-
22-
9+
class Scatter_Text_widget(FloatLayout):
10+
pass
2311

24-
Window.bind(mouse_pos = on_mouse_pos)
2512

2613

2714
#Builds the App
2815
class window(App):
2916
def build(self):
30-
return board_setup()
17+
return Scatter_Text_widget()

main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from kivy.config import Config
33
from kivy.core.window import Window
44

5+
56
def setup():
7+
68
width_of_board = 820
79
height_of_board = 800
810

@@ -27,7 +29,7 @@ def setup():
2729
'''
2830
TODO LIST
2931
30-
32+
FIX THE SPACING OF THE BUTTONS
3133
3234
2.5 CODE A DRAGGING SYSTEM AND A TOUCH-BASED SYSTEM
3335
2.75 MAKE THE DRAGGING SYSTEM HAVE THE PIECES MOVE A LAYER UP FROM THE BOARD

0 commit comments

Comments
 (0)