text_size()

Sets the current font size.

Examples

example picture for text_size()
1
2
3
4
5
6
7
def setup():
    py5.background(0)
    py5.fill(255)
    py5.text_size(26)
    py5.text("WORD", 10, 50)
    py5.text_size(14)
    py5.text("WORD", 10, 70)

Description

Sets the current font size. This size will be used in all subsequent calls to the text() function. Font size is measured in units of pixels.

Underlying Java method: textSize

Syntax

text_size(size: float, /) -> None

Parameters

  • size: float - the size of the letters in units of pixels

Updated on September 11, 2021 16:51:34pm UTC