Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arcade/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from arcade.resources import resolve
from arcade.texture_atlas import TextureAtlasBase
from arcade.types import Color, Point, RGBOrA255
from arcade.types.rect import LRBT, Rect

__all__ = ["load_font", "Text", "create_text_sprite", "draw_text"]

Expand Down Expand Up @@ -578,6 +579,11 @@ def bottom(self) -> float:
"""Pixel location of the bottom content border."""
return self.label.bottom

@property
def rect(self) -> Rect:
"""Rect representing the bounds of the text."""
return LRBT(self.left, self.right, self.bottom, self.top)

Comment thread
DigiDuncan marked this conversation as resolved.
@property
def content_size(self) -> tuple[int, int]:
"""Get the pixel width and height of the text contents."""
Expand Down
Loading