Noble.Text
Text and font handling.
Constants
- Noble.Text.ALIGN_LEFT
-
An alternate way to call Playdate SDK's
kTextAlignment.left
- Noble.Text.ALIGN_RIGHT
-
An alternate way to call Playdate SDK's
kTextAlignment.right
- Noble.Text.ALIGN_CENTER
-
An alternate way to call Playdate SDK's
kTextAlignment.center
Fonts
You can use these fonts in your project, or override them with your own if you wish.
Usage
Noble.Text.FONT_SMALL = Graphics.font.new("assets/fonts/MySmallFont") Noble.Text.setFont(Noble.Text.FONT_SMALL)
- Noble.Text.FONT_SYSTEM
- The Playdate system font.
- Noble.Text.FONT_SMALL
- Noble Sans: A sans-serif 8×9 font, with English and Japanese-Kana character sets.
- Noble.Text.FONT_MEDIUM
- Noble Slab: (This font is not ready yet!)
- Noble.Text.FONT_LARGE
- Satchel Roughed: A sans-serif 17×14 rounded font, with an English character set.
Functions
- Noble.Text.getCurrentFont()
-
Returns
-
The currently set font.
- Noble.Text.setFont(__font, __variant)
-
Set the current font
Parameters
- __font
any - __variant
any
- __font
- Noble.Text.draw(__string, __x, __y[, __alignment=Noble.Text.ALIGN_LEFT[, __localized=false[, __font=Noble.Text.getCurrentFont()]]])
-
Abstracts multiple
playdate.text
drawing functions into one.Parameters
- __string
string
Display text or localization key. - __x
number
- __y
number
- __alignment
= Noble.Text.ALIGN_LEFT (default)
Left, right, or center! - __localized
boolean
= false (default)
If true,__string
is a localization key rather than display text. - __font
= Noble.Text.getCurrentFont() (default)
A font to use. If not set, thecurrentFont
is used. If set, thecurrentFont
is not updated.
- __string
string