Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
211 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
"""Draw Zero, a zero-boilerplate graphing library for education. | ||
""" | ||
Draw Zero, a zero-boilerplate graphing library for education. | ||
__version__ = '0.1.4' | ||
Functions: | ||
line(color='red', start=(100, 100), end=(200, 200)) | ||
circle(color='red', pos=(100, 100), radius=10) | ||
filled_circle(color='red', pos=(100, 100), radius=10) | ||
rect(color='red', pos=(100, 100), width=500, height=200) | ||
filled_rect(color='red', pos=(100, 100), width=500, height=200) | ||
polygon(color='red', *points) | ||
filled_polygon(color='red', *points) | ||
text(color='red', text='', pos=(100, 100), fontsize=24) | ||
clear() | ||
fill(color='red') | ||
blit(image, pos) | ||
""" | ||
|
||
__version__ = '0.1.10' | ||
|
||
from .drawzero import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
def jsonize(parms, sep=','): | ||
if type(parms) == int or type(parms) == float: | ||
return str(parms) | ||
elif type(parms) == str: | ||
return '"' + parms.replace('"', '\\"') + '"' | ||
elif type(parms) == list or type(parms) == tuple: | ||
return '[' + sep.join(map(jsonize, parms)) + ']' | ||
else: | ||
raise ValueError('Тип не поддерживается') | ||
|
||
|
||
def draw_resize(*parms): | ||
print('resize', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_line(*parms): | ||
print('line', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_circle(*parms): | ||
print('circle', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_filled_circle(*parms): | ||
print('filled_circle', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_rect(*parms): | ||
print('rect', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_filled_rect(*parms): | ||
print('filled_rect', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_polygon(*parms): | ||
print('polygon', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_filled_polygon(*parms): | ||
print('filled_polygon', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_text(*parms): | ||
print('text', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_fill(*parms): | ||
print('fill', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_clear(*parms): | ||
print('clear', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_blit(*parms): | ||
print('blit', format(jsonize(parms, sep=', '))) | ||
|
||
|
||
def draw_tick(r=1): | ||
print('tick({})'.format(r)) | ||
|
||
|
||
def draw_sleep(t=1): | ||
print('sleep({})'.format(t)) | ||
|
||
|
||
def draw_set_line_width(w): | ||
print('set_line_width({})'.format(w)) | ||
pass | ||
|
||
|
||
surface_size = 1000 |
Oops, something went wrong.