-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
454: Some docs about text rendering r=pathunstrom a=astronouth7303 Right up some quick API docs about text Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
============== | ||
Text Rendering | ||
============== | ||
|
||
ppb supports basic text rendering: single font, single style, no wrapping. Rendered fonts are graphical Assets that can be used any place you'd use :py:class:`ppb.Image` | ||
|
||
.. code-block:: python | ||
class Label(ppb.sprite): | ||
image = ppb.Text("Hello, World", font=ppb.Font("resources/noto.ttf", size=12)) | ||
TrueType and OpenType fonts (both ``.ttf``) are supported, but must be shipped with your game. (System fonts are not supported.) | ||
|
||
Note that fonts require a size in points. This controls the size the text is rendered at, but the size on screen is still controlled by :py:attr:`Sprite.size`. | ||
|
||
.. autoclass:: ppb.Font | ||
|
||
.. autoclass:: ppb.Text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters