[docs]class TFT:
"""The TFT display driver.
When the "codex" module loads, it creates "codex.tft" (the singleton instance of this TFT
class). It also creates an initial root Canvas in "codex.display" and a console Canvas in
"codex.console". You can get this "codex.display" and start drawing on the screen with it.
You can get this "codex.console" and start printing text over the drawings.
Or you can create a new Canvas and use "tft.display=" and "tft.console=" to replace the
existing Canvases.
The default "codex.tft" is set to "auto_update=True". The display will automatically refresh
with any changes you make to the display or console.
For advanced applications, you can set the "codex.tft" to "auto_update=False". The screen
will only update when you call "update" on the "codex.tft" object. This allows you to make lots
of changes to the object tree and show the changes all at once.
"""
def __init__(self, auto_update=True, transparent_color=(0,0,0), backlight_pwm=None):
"""Create the TFT controller. There should be exactly one of these -- ever.
Don't create one of these yourself. Instead, use "codex.tft".
Args:
auto_update (bool, optional): Initial state of the display auto-update. Default is True.
"""
# Implemented in C
pass
@property
def brightness(self):
"""Get or set the TFT backlight level.
The default is 80 (80%).
The brightness is a percent between 0 (off) and 100 (full on).
"""
# Implemented in C
pass
@brightness.setter
def brightness(self,value):
# Implemented in C
pass
@property
def display(self):
"""Get or set the root display Canvas.
The display canvas is drawn beneath the console object.
"""
# Implemented in C
pass
@display.setter
def display(self,value):
# Implemented in C
pass
@property
def console(self):
"""Get or set the root console Canvas.
The console canvas is drawn above the display object.
"""
# Implemented in C
pass
@console.setter
def console(self,value):
# Implemented in C
pass
@property
def auto_update(self):
"""Get or set the auto-update status.
The default is True.
In "auto_update=True" mode, changes to the screen happen automatically
as soon as they are made.
In "auto_update=False" mode, changes to the screen must be triggered
manually with the "update()" method.
"""
# Implemented in C
pass
@auto_update.setter
def auto_update(self,value):
# Implemented in C
pass
[docs] def update(self):
"""Manually redraw the display.
This is used in "auto_update=False" mode to update the display.
"""
# Implemented in C
pass