|
@@ -2,6 +2,8 @@ def canvas_update() -> None:
|
|
|
'''
|
|
'''
|
|
|
Updates the display buffer with your drawings from the canvas.
|
|
Updates the display buffer with your drawings from the canvas.
|
|
|
|
|
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
|
|
+
|
|
|
.. note::
|
|
.. note::
|
|
|
|
|
|
|
|
Your drawings will only appear on the display after this function call.
|
|
Your drawings will only appear on the display after this function call.
|
|
@@ -12,6 +14,8 @@ def canvas_clear() -> None:
|
|
|
'''
|
|
'''
|
|
|
Clear the whole canvas. This does not affect the current display buffer.
|
|
Clear the whole canvas. This does not affect the current display buffer.
|
|
|
You need to call :func:`canvas_update` to reveal your changes.
|
|
You need to call :func:`canvas_update` to reveal your changes.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -19,6 +23,8 @@ def canvas_width() -> int:
|
|
|
'''
|
|
'''
|
|
|
Get the canvas width in pixels.
|
|
Get the canvas width in pixels.
|
|
|
|
|
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
|
|
+
|
|
|
:returns: The canvas width.
|
|
:returns: The canvas width.
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
@@ -27,6 +33,8 @@ def canvas_height() -> int:
|
|
|
'''
|
|
'''
|
|
|
Get the canvas height in pixels.
|
|
Get the canvas height in pixels.
|
|
|
|
|
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
|
|
+
|
|
|
:returns: The canvas height.
|
|
:returns: The canvas height.
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
@@ -34,17 +42,23 @@ def canvas_height() -> int:
|
|
|
COLOR_BLACK: int
|
|
COLOR_BLACK: int
|
|
|
'''
|
|
'''
|
|
|
Constant value for the color `black`.
|
|
Constant value for the color `black`.
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
COLOR_WHITE: int
|
|
COLOR_WHITE: int
|
|
|
'''
|
|
'''
|
|
|
Constant value for the color `white`.
|
|
Constant value for the color `white`.
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
def canvas_set_color(color: int) -> None:
|
|
def canvas_set_color(color: int) -> None:
|
|
|
'''
|
|
'''
|
|
|
Set the color to use when drawing or writing on the canvas.
|
|
Set the color to use when drawing or writing on the canvas.
|
|
|
|
|
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
|
|
+
|
|
|
:param color: The color to use.
|
|
:param color: The color to use.
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
@@ -52,16 +66,22 @@ def canvas_set_color(color: int) -> None:
|
|
|
ALIGN_BEGIN: int
|
|
ALIGN_BEGIN: int
|
|
|
'''
|
|
'''
|
|
|
Align element at `begin` (horizontal or vertical, depends on the context).
|
|
Align element at `begin` (horizontal or vertical, depends on the context).
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
ALIGN_END: int
|
|
ALIGN_END: int
|
|
|
'''
|
|
'''
|
|
|
Align element at `end` (horizontal or vertical, depends on the context).
|
|
Align element at `end` (horizontal or vertical, depends on the context).
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
ALIGN_CENTER: int
|
|
ALIGN_CENTER: int
|
|
|
'''
|
|
'''
|
|
|
Align element at `center` (horizontal or vertical, depends on the context).
|
|
Align element at `center` (horizontal or vertical, depends on the context).
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
def canvas_set_text_align(x: int, y: int) -> None:
|
|
def canvas_set_text_align(x: int, y: int) -> None:
|
|
@@ -71,17 +91,23 @@ def canvas_set_text_align(x: int, y: int) -> None:
|
|
|
|
|
|
|
|
:param x: The horizontal alignment.
|
|
:param x: The horizontal alignment.
|
|
|
:param y: The vertical alignment.
|
|
:param y: The vertical alignment.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
FONT_PRIMARY: int
|
|
FONT_PRIMARY: int
|
|
|
'''
|
|
'''
|
|
|
Constant value for the primary font.
|
|
Constant value for the primary font.
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
FONT_SECONDARY: int
|
|
FONT_SECONDARY: int
|
|
|
'''
|
|
'''
|
|
|
Constant value for the secondary font.
|
|
Constant value for the secondary font.
|
|
|
|
|
+
|
|
|
|
|
+.. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
def canvas_set_font(font: int) -> None:
|
|
def canvas_set_font(font: int) -> None:
|
|
@@ -89,6 +115,8 @@ def canvas_set_font(font: int) -> None:
|
|
|
Change the font to use when writing on the canvas using the :func:`canvas_set_text` function.
|
|
Change the font to use when writing on the canvas using the :func:`canvas_set_text` function.
|
|
|
|
|
|
|
|
:param font: The font to use.
|
|
:param font: The font to use.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -99,6 +127,8 @@ def canvas_set_text(x: int, y: int, text: str) -> None:
|
|
|
:param x: The horizontal position.
|
|
:param x: The horizontal position.
|
|
|
:param y: The vertical position.
|
|
:param y: The vertical position.
|
|
|
:param text: The text to write.
|
|
:param text: The text to write.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
|
|
|
|
|
.. code-block::
|
|
.. code-block::
|
|
|
|
|
|
|
@@ -123,6 +153,8 @@ def canvas_draw_dot(x: int, y: int) -> None:
|
|
|
|
|
|
|
|
:param x: The horizontal position.
|
|
:param x: The horizontal position.
|
|
|
:param y: The vertical position.
|
|
:param y: The vertical position.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -136,6 +168,8 @@ def canvas_draw_box(x: int, y: int, w: int, h: int, r: int) -> None:
|
|
|
:param w: The width of the box.
|
|
:param w: The width of the box.
|
|
|
:param h: The height of the box.
|
|
:param h: The height of the box.
|
|
|
:param r: The corner radius to use.
|
|
:param r: The corner radius to use.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -149,6 +183,8 @@ def canvas_draw_frame(x: int, y: int, w: int, h: int, r: int) -> None:
|
|
|
:param w: The width of the box.
|
|
:param w: The width of the box.
|
|
|
:param h: The height of the box.
|
|
:param h: The height of the box.
|
|
|
:param r: The corner radius to use.
|
|
:param r: The corner radius to use.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -160,6 +196,8 @@ def canvas_draw_line(x0: int, y0: int, x1: int, y1: int) -> None:
|
|
|
:param y0: The vertical start position.
|
|
:param y0: The vertical start position.
|
|
|
:param x1: The horizontal end position.
|
|
:param x1: The horizontal end position.
|
|
|
:param y1: The vertical end sposition.
|
|
:param y1: The vertical end sposition.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -170,6 +208,8 @@ def canvas_draw_circle(x: int, y: int, r: int) -> None:
|
|
|
:param x: The horizontal position.
|
|
:param x: The horizontal position.
|
|
|
:param y: The vertical position.
|
|
:param y: The vertical position.
|
|
|
:param r: The radius to use.
|
|
:param r: The radius to use.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -180,5 +220,7 @@ def canvas_draw_disc(x: int, y: int, r: int) -> None:
|
|
|
:param x: The horizontal position.
|
|
:param x: The horizontal position.
|
|
|
:param y: The vertical position.
|
|
:param y: The vertical position.
|
|
|
:param r: The radius to use.
|
|
:param r: The radius to use.
|
|
|
|
|
+
|
|
|
|
|
+ .. versionadded:: 1.0.0
|
|
|
'''
|
|
'''
|
|
|
pass
|
|
pass
|