Skip to content

Commit

Permalink
Canvas class integrated into CanvasSection class
Browse files Browse the repository at this point in the history
  • Loading branch information
Thxios committed Mar 10, 2020
1 parent 443d531 commit dc9f77a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/TestSection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pygame as pg
from src.Section import ColorSection


section = ColorSection
pg.init()

w, h = 200, 250
section.Setup(0, 0, w, h)

screen = pg.display.set_mode((w, h))
mouseX, mouseY = 0, 0

while 1:
mouseX, mouseY = pg.mouse.get_pos()
for e in pg.event.get():
if e.type == pg.QUIT:
pg.quit()
quit()
elif e.type == pg.MOUSEBUTTONDOWN:
section.OnMouseDown(e.button, mouseX, mouseY)

section.Draw(screen)
4 changes: 2 additions & 2 deletions src/Window.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


class MainWindow:
w, h = 1600, 900
w, h = 1280, 720
bgColor = (78, 82, 84)

running = False
screen = None
clock = pg.time.Clock()
fps = 126

originX, originY = 200, 600
originX, originY = 200, h - 250

Brush.SetBrush('Pencil')
# ----- for test -----
Expand Down

0 comments on commit dc9f77a

Please sign in to comment.