Commit Graph

29 Commits

Author SHA1 Message Date
Taku Fukada 56c898da80 Modify some Python stubs 2020-08-07 01:01:28 +09:00
Scott Shawcroft 05a1519e5d
Merge pull request #3214 from kmatch98/bitmap_write
Updated Group.c to correct bug with insert into displayio.Group
2020-07-29 10:46:33 -07:00
Margaret Matocha 0887bc2112 Updated to remove else statment, attempt to remove excess mpy-cross... file 2020-07-28 15:03:51 -05:00
Margaret Matocha 076c5f946f Updated to remove unnecessary else statement 2020-07-28 14:53:50 -05:00
Margaret Matocha fd7801415a Deleted mpy-cross file 2020-07-28 14:53:09 -05:00
Margaret Matocha db26e894fb Updated Group.c to correct bug with insert into groups 2020-07-27 22:25:21 -05:00
Taku Fukada d356581651 Fix several type hints 2020-07-27 18:05:13 +09:00
Taku Fukada 54a342a7f5 Add and correct some type hints 2020-07-24 18:20:03 +09:00
dherrada bfcaa4b2b4 Made requested changes in displayio 2020-07-16 16:11:22 -04:00
dherrada d0d949cd24 Made every init return None 2020-07-03 14:23:34 -04:00
dherrada 3df03a5650 Made most of the requested changes 2020-07-03 13:49:00 -04:00
dherrada 783cc4de39 Added type hints to displayio 2020-07-03 10:05:14 -04:00
dherrada 54cb1feea0 Removed all 'self, )' 2020-07-02 13:28:36 -04:00
Scott Shawcroft 4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
dherrada 2ebe3035df
Did board, digitalio, displayio 2020-05-07 10:54:09 -04:00
Scott Shawcroft 949f8761b8
Add .hidden to TileGrid and Group
This allows for one to preserve ordering within a Group while
hiding something temporarily.

Fixes #1688
2019-09-03 16:15:27 -07:00
Scott Shawcroft 745ff8f8c1
Fix Group subscr to detect delete correctly
Fixes #1957
2019-07-02 18:15:23 -07:00
Scott Shawcroft 5608e273a0
Add index and remove to Group. 2019-05-15 11:33:16 -07:00
Scott Shawcroft b7b55e0c0a
Make Group iterable via a generic native iterator.
Fixes #1694
2019-05-14 15:15:23 -07:00
Scott Shawcroft f29de51325
Check native object in case of early access
If a native displayio object is accessed before it's super().__init__()
has been called, then a placeholder is given that will cause a crash if
accessed. This is tricky to get right so we detect this case and raise
a NotInplementedError instead of crashing.

Fixes #1881
2019-05-13 17:31:30 -07:00
Scott Shawcroft 224e9b1009
Standardize TileGrid to x and y properties over position
This brings it inline with Group. Also fixes #1613

This also includes a number of fixes for where a method is called
through a subclass. We now correctly get the native object.
Fixes #1567

Lastly, this adds subscript support to TileGrid for changing tile
indices. Similar to Bitmap, it accepts ints or 2-tuples.
2019-03-12 17:18:33 -07:00
Scott Shawcroft ea45877ca5
Accept x and y kwargs into Group for initial position. 2019-03-12 17:17:32 -07:00
Scott Shawcroft 473bdf48f6
A safe mode fix and displayio fixes
* Fixes safe mode on the SAMD51. The "preserved" value was being
clobbered by the bootloader.
* Fixes auto-reload loop when in safe mode.
* Fixes reading Group children with [].
* Check that a TileGrid actually moves before queueing a refresh.
2019-02-13 15:31:06 -08:00
Scott Shawcroft 1e16b3e134
Tweaks based on dhalbert's feedback. 2019-02-12 14:18:53 -08:00
Scott Shawcroft c17f147be9
A variety of displayio improvements
This changes a number of things in displayio:
* Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with
  a font it is available as board.TERMINAL_FONT. Fixes #1172
* Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191
* Add width and height properties to Bitmap.
* Add insert and [] access to Group. Fixes #1518
* Add index param to pop on Group.
* Terminal no longer takes unicode character info. It takes a BuiltinFont instead.
* Fix Terminal's handling of [###D vt100 commands used when up arrowing into repl history.
* Add x and y positions to Group plus scale as well.
* Add bitmap accessor for BuiltinFont
2019-02-11 20:55:05 -08:00
Scott Shawcroft 747f2cfe26
Add subclass support to displayio.
Also, swap make_news to accept a kwarg map and refine param checking.

Fixes #1237
2019-01-14 17:29:19 -08:00
Scott Shawcroft f21cf15c38
Add OnDiskBitmap which loads pixel data straight from disk.
Also, renamed Sprite's palette to pixel_shader so it can be
anything that produces colors based on values (including color values).
Added a ColorConverter that converts RGB888 (found in bitmaps) to
RGB565 for the display.

Fixes #1182
2018-09-12 15:25:59 -07:00
Scott Shawcroft 121903b6ee
Tweaks based on feedback 2018-08-31 14:21:48 -07:00
Scott Shawcroft 6697544cdf
Introduce displayio to render graphics to displays.
It's designed to minimize RAM footprint by using Sprites to
represent objects on the screen. The object model also facilitates
partial screen updating which reduces the bandwidth needed to display.

This is all handled in C. Python simply manipulates the objects with
the ability to synchronize to frame timing.
2018-08-31 12:31:52 -07:00