Documentation
Casioplot package
All public functions from the casioplot module are accessible in this package.
- casioplot.clear_screen() None
Clear the canvas, sets every pixel to white
- casioplot.draw_string(x: int, y: int, text: str, color: tuple[int, int, int] = (0, 0, 0), size: Literal['small', 'medium', 'large'] = 'medium') None
Draw a string on the canvas with the given RGB color and size.
- Parameters:
x – x coordinate (from the left)
y – y coordinate (from the top)
text – text that will be drawn
color – The color of the text. A tuple that contain 3 integers from 0 to 255
size – Size of the text. String from the following values:
"small","medium"or"large"
- Raises:
ValueError – Raise a
ValueErrorif the size isn’t correct
- casioplot.get_pixel(x: int, y: int) tuple[int, int, int] | None
Get the RGB color of the pixel at the given coordinates of the canvas
Using a try statement is faster than checking if the coordinates are in bounds
- Parameters:
x – x coordinate (from the left)
y – y coordinate (from the top)
- Returns:
The pixel color. A tuple that contain 3 integers from 0 to 255 or None if the pixel is out of the canvas
- casioplot.set_pixel(x: int, y: int, color: tuple[int, int, int] = (0, 0, 0)) None
Set the RGB color of the pixel at the given coordinates
Using a try statement is faster than checking if the coordinates are in bounds.
- Parameters:
x – x coordinate (from the left)
y – y coordinate (from the top)
color – The pixel color. A tuple that contain 3 integers from 0 to 255
- casioplot.show_screen() None
Shows or saves the virtual screen
This function implement two distinct modes:
show the virtual screen in real time in a tkinter window, if
show_screenis TrueSave the virtual screen to the disk, if
save_screenin True
These modes are independent and can work at the same time