mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
resources renamed to media.ev3dev
This commit is contained in:
@@ -28,7 +28,6 @@ Intro
|
||||
parameters
|
||||
tools
|
||||
robotics
|
||||
resources
|
||||
media
|
||||
|
||||
.. toctree::
|
||||
|
||||
+83
-1
@@ -10,7 +10,89 @@ folder. You can also use any of the images and sounds built into Pybricks.
|
||||
ev3dev
|
||||
------
|
||||
|
||||
These images and sounds are only available for Pybricks on ev3dev.
|
||||
.. automodule:: pybricks.media.ev3dev
|
||||
:no-members:
|
||||
|
||||
|
||||
Graphical Images
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. autoclass:: pybricks.media.ev3dev.Image
|
||||
:no-members:
|
||||
|
||||
.. rubric:: Drawing Text
|
||||
|
||||
There are two ways to draw text on images. :meth:`draw_text` lets text be
|
||||
placed precisely on the image or :meth:`print` can be used to automatically
|
||||
print text on a new line.
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_text
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.print
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.set_font
|
||||
|
||||
|
||||
.. rubric:: Drawing Images
|
||||
|
||||
A copy of another image can be drawn on an image. Also consider using
|
||||
sub-images to copy part of an image.
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_image
|
||||
|
||||
|
||||
.. rubric:: Drawing Shapes
|
||||
|
||||
These are the methods to draw basic shapes, including points, lines,
|
||||
rectangles and circles.
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_pixel
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_line
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_box
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.draw_circle
|
||||
|
||||
|
||||
.. rubric:: Image properties
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Image.width
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Image.height
|
||||
|
||||
|
||||
.. rubric:: Replacing the Entire Image
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.clear
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.show_image
|
||||
|
||||
|
||||
Fonts
|
||||
^^^^^
|
||||
|
||||
.. autoclass:: pybricks.media.ev3dev.Font
|
||||
:no-members:
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Font.DEFAULT
|
||||
:annotation: = Font('Lucida', 12)
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Font.family
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Font.style
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Font.width
|
||||
|
||||
.. autoattribute:: pybricks.media.ev3dev.Font.height
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Font.text_width
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Font.text_height
|
||||
|
||||
|
||||
Files
|
||||
^^^^^
|
||||
|
||||
.. autoclass:: pybricks.media.ev3dev.ImageFile
|
||||
:no-members:
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
:mod:`resources <pybricks.resources>` -- Resources
|
||||
==================================================
|
||||
|
||||
.. automodule:: pybricks.resources
|
||||
:no-members:
|
||||
|
||||
Graphical Images
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. autoclass:: pybricks.resources.Image
|
||||
:no-members:
|
||||
|
||||
.. rubric:: Drawing Text
|
||||
|
||||
There are two ways to draw text on images. :meth:`draw_text` lets text be
|
||||
placed precisely on the image or :meth:`print` can be used to automatically
|
||||
print text on a new line.
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_text
|
||||
|
||||
.. automethod:: pybricks.resources.Image.print
|
||||
|
||||
.. automethod:: pybricks.resources.Image.set_font
|
||||
|
||||
|
||||
.. rubric:: Drawing Images
|
||||
|
||||
A copy of another image can be drawn on an image. Also consider using
|
||||
sub-images to copy part of an image.
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_image
|
||||
|
||||
|
||||
.. rubric:: Drawing Shapes
|
||||
|
||||
These are the methods to draw basic shapes, including points, lines,
|
||||
rectangles and circles.
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_pixel
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_line
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_box
|
||||
|
||||
.. automethod:: pybricks.resources.Image.draw_circle
|
||||
|
||||
|
||||
.. rubric:: Image properties
|
||||
|
||||
.. autoattribute:: pybricks.resources.Image.width
|
||||
|
||||
.. autoattribute:: pybricks.resources.Image.height
|
||||
|
||||
|
||||
.. rubric:: Replacing the Entire Image
|
||||
|
||||
.. automethod:: pybricks.resources.Image.clear
|
||||
|
||||
.. automethod:: pybricks.resources.Image.show_image
|
||||
|
||||
|
||||
Fonts
|
||||
^^^^^
|
||||
|
||||
.. autoclass:: pybricks.resources.Font
|
||||
:no-members:
|
||||
|
||||
.. autoattribute:: pybricks.resources.Font.DEFAULT
|
||||
:annotation: = Font('Lucida', 12)
|
||||
|
||||
.. autoattribute:: pybricks.resources.Font.family
|
||||
|
||||
.. autoattribute:: pybricks.resources.Font.style
|
||||
|
||||
.. autoattribute:: pybricks.resources.Font.width
|
||||
|
||||
.. autoattribute:: pybricks.resources.Font.height
|
||||
|
||||
.. automethod:: pybricks.resources.Font.text_width
|
||||
|
||||
.. automethod:: pybricks.resources.Font.text_height
|
||||
+3
-3
@@ -24,7 +24,7 @@ sys.path.insert(0, os.path.abspath('../..'))
|
||||
|
||||
from pybricks import _version # noqa E402
|
||||
from pybricks.hubs import EV3Brick # noqa E402
|
||||
from pybricks.resources import Image # noqa E402
|
||||
from pybricks.media.ev3dev import Image # noqa E402
|
||||
from pybricks.builtins import Speaker # noqa E402
|
||||
|
||||
# ON_RTD is whether we are on readthedocs.org
|
||||
@@ -287,9 +287,9 @@ def find_obj(self, env, modname, classname, name, type, searchmode=0):
|
||||
if modname == 'pybricks.hubs':
|
||||
if classname == 'screen':
|
||||
if name.startswith('Font.') or name == 'Font':
|
||||
modname = 'pybricks.resources'
|
||||
modname = 'pybricks.media.ev3dev'
|
||||
elif name.startswith('Image.') or name == 'Image':
|
||||
modname = 'pybricks.resources'
|
||||
modname = 'pybricks.media.ev3dev'
|
||||
else:
|
||||
classname = 'EV3Brick.screen'
|
||||
elif classname == 'speaker':
|
||||
|
||||
Reference in New Issue
Block a user