Skip to content

Commit

Permalink
Better feedback when creating Text without window (#1952)
Browse files Browse the repository at this point in the history
closes: #1823
  • Loading branch information
einarf committed Jan 16, 2024
1 parent b396a4a commit 01a53fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arcade/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def __init__(
group: Optional[pyglet.graphics.Group] = None,
start_z: int = 0
):
# Raises a RuntimeError if no window for better user feedback
arcade.get_window()

if align != "center" and align != "left" and align != "right":
raise ValueError("The 'align' parameter must be equal to 'left', 'right', or 'center'.")

Expand Down

0 comments on commit 01a53fb

Please sign in to comment.