PyDraw - v0.0.1-alpha
This is a drawing program for making sprites, it is still in development and won't be ready for a while.
Harry Syred
(Haz_01)
This is a drawing program for making sprites, it is still in development and won't be ready for a while.
This needs python3.x and PyGames only.
Under Mozilla Public License Version 2.0
Features:
- Colour picker
- Zoom
- Options menu
- Size settings
ToDo List:
- Save
- zoom settings
- Open
- Shortcut
This needs python3.x and PyGames only.
Under Mozilla Public License Version 2.0
Features:
- Colour picker
- Zoom
- Options menu
- Size settings
ToDo List:
- Save
- zoom settings
- Open
- Shortcut
Changes
Just an alpha version. No, save functionality, just the ability to draw. Screenshots could save it but you will have to start from scratch to edit any of it.
Still cool though
Links
Releases
PyDraw https://github.com/Haz001/PyDraw — 22 May, 2019
PyDraw v0.0.2-alpha — 27 May, 2019
PyDraw v0.0.1-alpha — 27 May, 2019
PyDraw v0.0.3-alpha — 7 Jun, 2019
PyDraw v0.0.5-alpha — 6 Jul, 2019
Pygame.org account Comments
-
plutonion 2019-05-26 16:27
I've just updated your code. !!! YOU NEED TO INSTALL tkcolorpicker BEFORE !!! The code: import pygame from pygame.gfxdraw import * from tkinter import * from tkcolorpicker import askcolor import json run=True def AskColor(): global penColor #To change it (Because I've declared it after the function.) root_buffer=Tk() #A buffer to stock a screen color_temp=askcolor(parent=root_buffer,alpha=True) #But you can change to False root_buffer.destroy() #And delete the background display (Created by tkinter) if color_temp==None: return penColor else: return color_temp[0] def save(): open('save.json','w').write(json.dumps(pixels, sort_keys=True,indent=4, separators=(',', ': ')) ) def load(): global pixels try: pixels=json.load(open('save.json')) print('save.json have been loaded !') except: print('No save detected !') screen = pygame.display.set_mode((1000,700),pygame.RESIZABLE) #Just create a simple display bg=(0,0,0)#Background penColor=(155,155,155) pixels=[]#All pixels, can be save as a json file later PixelSize=20 while run: PixelSize=max(0,PixelSize) #To not divide by zero. mx,my=pygame.mouse.get_pos() #Get the exact position of mouse cx,cy=int(mx/PixelSize)*PixelSize,int(my/PixelSize)*PixelSize #Convert to box area mouse position screen.fill(bg) rectangle(screen,((cx,cy),(PixelSize,PixelSize)),(255-penColor[0],255-penColor[1],255-penColor[2]) ) #^^^Draw a rectangle with inverted brush's color to see where you paint the pixel ^^^ for i in pixels:#Blit all pixels box(screen,((i['x']*PixelSize,i['y']*PixelSize),(PixelSize,PixelSize)),(i['color'])) for event in pygame.event.get(): if event.type == pygame.QUIT: run=False if event.type == pygame.VIDEORESIZE: screen=pygame.display.set_mode(event.dict['size'],pygame.RESIZABLE) if event.type == pygame.MOUSEBUTTONDOWN: if event.button==1: pixels.append({'x':cx//PixelSize,'y':cy//PixelSize,'color':penColor}) if event.button==4: #Scroll zoom in PixelSize+=5 if event.button==5: #Scroll zoom out PixelSize-=5 if event.type == pygame.KEYDOWN: if event.key == pygame.K_s: save() elif event.key == pygame.K_l: load() elif event.key == pygame.K_DELETE: pixels=[] else: penColor=AskColor() pygame.display.update() pygame.quit()