Skip to content

Commit

Permalink
01
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Dec 2, 2024
1 parent 7515bcc commit 267785c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Binary file added 2024/sketch_2024_12_01/sketch_2024_12_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 2024/sketch_2024_12_01/sketch_2024_12_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import py5

drag = None

def setup():
global surface, f
py5.size(500, 500)
#py5.window_resizable(True)
surface = py5.get_surface()
f = surface.get_native().getFrame()
f.removeNotify()
f.setUndecorated(True)
f.setOpacity(0.5)
f.addNotify()

def draw():
#py5.background(255, 0, 0)
py5.circle(py5.width / 2, py5.height / 2, py5.width)
py5.window_x = py5.mouse_x

def mouse_pressed():
global drag
drag = py5.mouse_x, py5.mouse_y, py5.window_x, py5.window_y

def mouse_released():
global drag
if drag:
px, py, wx, wy = drag
dx = py5.pmouse_x - px
dy = py5.pmouse_y - py
surface.set_location(wx + dx , wy + dy)
drag = None

py5.run_sketch(block=False)
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ Here are listed some of the tools I have been using more recently:
2024 \| [<b>2023</b>](2023.md) \| [<b>2022</b>](2022.md) \| [<b>2021</b>](2021.md) \| [<b>2020</b>](2020.md) \| [<b>2019</b>](2019.md) \| [<b>2018</b>](2018.md)


---

### sketch_2024_12_01

![sketch_2024_12_01](https://raw.githubusercontent.com/villares/sketch-a-day/main/2024/sketch_2024_12_01/sketch_2024_12_01.png)

[sketch_2024_12_01](https://github.com/villares/sketch-a-day/tree/main/2024/sketch_2024_12_01) [[py5](https://py5coding.org/)]



---

### sketch_2024_11_30
Expand Down

0 comments on commit 267785c

Please sign in to comment.