:mod:`vectorio`
===============
.. py:module:: vectorio
.. autoapi-nested-parse::
Lightweight 2D shapes for displays
The :py:attr:`vectorio` module provide simple filled drawing primitives for
use with `displayio`.
.. code-block:: python
group = displayio.Group()
palette = displayio.Palette(1)
palette[0] = 0x125690
circle = vectorio.Circle(pixel_shader=palette, radius=25, x=70, y=40)
group.append(circle)
rectangle = vectorio.Rectangle(pixel_shader=palette, width=40, height=30, x=55, y=45)
group.append(rectangle)
points=[(5, 5), (100, 20), (20, 20), (20, 100)]
polygon = vectorio.Polygon(pixel_shader=palette, points=points, x=0, y=0)
group.append(polygon)
.. raw:: html
Available on these boards
- AITHinker ESP32-C3S_Kit
- ARAMCON Badge 2019
- ARAMCON2 Badge
- ATMegaZero ESP32-S2
- Adafruit CLUE nRF52840 Express
- Adafruit Circuit Playground Bluefruit
- Adafruit EdgeBadge
- Adafruit Feather Bluefruit Sense
- Adafruit Feather ESP32-S2 TFT
- Adafruit Feather ESP32S2
- Adafruit Feather M4 CAN
- Adafruit Feather M4 Express
- Adafruit Feather MIMXRT1011
- Adafruit Feather RP2040
- Adafruit Feather STM32F405 Express
- Adafruit Feather nRF52840 Express
- Adafruit FunHouse
- Adafruit Grand Central M4 Express
- Adafruit Hallowing M4 Express
- Adafruit ItsyBitsy M4 Express
- Adafruit ItsyBitsy RP2040
- Adafruit ItsyBitsy nRF52840 Express
- Adafruit KB2040
- Adafruit LED Glasses Driver nRF52840
- Adafruit Macropad RP2040
- Adafruit MagTag
- Adafruit Matrix Portal M4
- Adafruit Metro ESP32S2
- Adafruit Metro M4 Airlift Lite
- Adafruit Metro M4 Express
- Adafruit Metro nRF52840 Express
- Adafruit Monster M4SK
- Adafruit PyGamer
- Adafruit PyPortal
- Adafruit PyPortal Pynt
- Adafruit PyPortal Titano
- Adafruit Pybadge
- Adafruit QT Py ESP32S2
- Adafruit QT Py RP2040
- Adafruit QT2040 Trinkey
- Adafruit Trellis M4 Express
- AloriumTech Evo M51
- Arduino Nano 33 BLE
- Arduino Nano RP2040 Connect
- Artisense Reference Design RD00
- AtelierDuMaker nRF52840 Breakout
- BDMICRO VINA-D51
- BLE-SS dev board Multi Sensor
- BastBLE
- BastWiFi
- BlueMicro840
- CP32-M4
- Capable Robot Programmable USB Hub
- Challenger NB RP2040 WiFi
- Challenger RP2040 LTE
- Challenger RP2040 WiFi
- CircuitBrains Deluxe
- CrumpS2
- Cytron Maker Nano RP2040
- Cytron Maker Pi RP2040
- DynOSSAT-EDU-OBC
- ESP 12k NodeMCU
- Electronut Labs Blip
- Electronut Labs Papyr
- EncoderPad RP2040
- Espruino Wifi
- Feather ESP32S2 without PSRAM
- Feather MIMXRT1011
- Feather MIMXRT1062
- FeatherS2
- FeatherS2 Neo
- FeatherS2 PreRelease
- Franzininho WIFI w/Wroom
- Franzininho WIFI w/Wrover
- Gravitech Cucumber M
- Gravitech Cucumber MS
- Gravitech Cucumber R
- Gravitech Cucumber RS
- HMI-DevKit-1.1
- HiiBot BlueFi
- IMXRT1010-EVK
- IkigaiSense Vita nRF52840
- Kaluga 1
- LILYGO TTGO T8 ESP32-S2 w/Display
- MDBT50Q-DB-40
- MDBT50Q-RX Dongle
- MEOWBIT
- MORPHEANS MorphESP-240
- MakerDiary nRF52840 MDK
- MakerDiary nRF52840 MDK USB Dongle
- Makerdiary M60 Keyboard
- Makerdiary Pitaya Go
- Makerdiary nRF52840 M.2 Developer Kit
- Melopero Shake RP2040
- Metro MIMXRT1011
- MicroDev microC3
- MicroDev microS2
- Mini SAM M4
- NUCLEO STM32F746
- NUCLEO STM32F767
- NUCLEO STM32H743
- OPENMV-H7 R1
- Oak Dev Tech BREAD2040
- Oak Dev Tech PixelWing ESP32S2
- Open Hardware Summit 2020 Badge
- PCA10056 nRF52840-DK
- PCA10059 nRF52840 Dongle
- PYB LR Nano V2
- Particle Argon
- Particle Boron
- Particle Xenon
- Pimoroni Interstate 75
- Pimoroni Keybow 2040
- Pimoroni PGA2040
- Pimoroni Pico LiPo (16MB)
- Pimoroni Pico LiPo (4MB)
- Pimoroni PicoSystem
- Pimoroni Plasma 2040
- Pimoroni Tiny 2040
- PyKey60
- PyboardV1_1
- RP2040 Stamp
- Raspberry Pi 4B
- Raspberry Pi Compute Module 4 IO Board
- Raspberry Pi Pico
- Raspberry Pi Zero 2W
- S2Mini
- S2Pico
- SAM E54 Xplained Pro
- SAM32v26
- ST STM32F746G Discovery
- STM32F412G_DISCO
- STM32F4_DISCO
- Saola 1 w/Wroom
- Saola 1 w/Wrover
- Seeeduino Wio Terminal
- Silicognition LLC M4-Shim
- SparkFun MicroMod RP2040 Processor
- SparkFun MicroMod SAMD51 Processor
- SparkFun MicroMod nRF52840 Processor
- SparkFun Pro Micro RP2040
- SparkFun Pro nRF52840 Mini
- SparkFun STM32 MicroMod Processor
- SparkFun Thing Plus - RP2040
- SparkFun Thing Plus - SAMD51
- TG-Boards' Datalore IP M4
- TG-Watch
- THUNDERPACK_v12
- Targett Module Clip w/Wroom
- Targett Module Clip w/Wrover
- Teensy 4.0
- Teensy 4.1
- Teknikio Bluebird
- The Open Book Feather
- Thingz - Galaxia
- TinkeringTech ScoutMakes Azul
- TinyS2
- UARTLogger II
- WarmBit BluePixel nRF52840
- iMX RT 1020 EVK
- iMX RT 1060 EVK
- nanoESP32-S2 w/Wrover
- nanoESP32-S2 w/Wroom
- nice!nano
- stm32f411ce-blackpill
- stm32f411ce-blackpill-with-flash
.. py:class:: Circle(pixel_shader: Union[displayio.ColorConverter, displayio.Palette], radius: int, x: int, y: int)
Circle is positioned on screen by its center point.
:param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel shader that produces colors from values
:param int radius: The radius of the circle in pixels
:param int x: Initial x position of the axis.
:param int y: Initial y position of the axis.
.. py:attribute:: radius
:annotation: :int
The radius of the circle in pixels.
.. py:attribute:: x
:annotation: :int
X position of the center point of the circle in the parent.
.. py:attribute:: y
:annotation: :int
Y position of the center point of the circle in the parent.
.. py:attribute:: location
:annotation: :Tuple[int, int]
(X,Y) position of the center point of the circle in the parent.
.. py:attribute:: pixel_shader
:annotation: :Union[displayio.ColorConverter, displayio.Palette]
The pixel shader of the circle.
.. py:class:: Polygon(pixel_shader: Union[displayio.ColorConverter, displayio.Palette], points: List[Tuple[int, int]], x: int, y: int)
Represents a closed shape by ordered vertices. The path will be treated as
'closed', the last point will connect to the first point.
:param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel
shader that produces colors from values
:param List[Tuple[int,int]] points: Vertices for the polygon
:param int x: Initial screen x position of the 0,0 origin in the points list.
:param int y: Initial screen y position of the 0,0 origin in the points list.
.. py:attribute:: points
:annotation: :List[Tuple[int, int]]
Vertices for the polygon.
.. py:attribute:: x
:annotation: :int
X position of the 0,0 origin in the points list.
.. py:attribute:: y
:annotation: :int
Y position of the 0,0 origin in the points list.
.. py:attribute:: location
:annotation: :Tuple[int, int]
(X,Y) position of the 0,0 origin in the points list.
.. py:attribute:: pixel_shader
:annotation: :Union[displayio.ColorConverter, displayio.Palette]
The pixel shader of the polygon.
.. py:class:: Rectangle(pixel_shader: Union[displayio.ColorConverter, displayio.Palette], width: int, height: int, x: int, y: int)
Represents a rectangle by defining its bounds
:param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel shader that produces colors from values
:param int width: The number of pixels wide
:param int height: The number of pixels high
:param int x: Initial x position of the top left corner.
:param int y: Initial y position of the top left corner.
.. py:attribute:: x
:annotation: :int
X position of the top left corner of the rectangle in the parent.
.. py:attribute:: y
:annotation: :int
Y position of the top left corner of the rectangle in the parent.
.. py:attribute:: location
:annotation: :Tuple[int, int]
(X,Y) position of the top left corner of the rectangle in the parent.
.. py:attribute:: pixel_shader
:annotation: :Union[displayio.ColorConverter, displayio.Palette]
The pixel shader of the rectangle.