Skip to content

AssertionError: When the parameters 'multiline' and 'wrap_lines' are True, the parameter 'width' must be a number #933

@alderven

Description

@alderven

Run this code:

import arcade

arcade.open_window(800, 600, 'Hello')
arcade.draw_text(text='Привет!', start_x=400, start_y=300, font_size=36, align='center')
arcade.run()

Getting error:

Traceback (most recent call last):
  File "C:/draw_text.py", line 4, in <module>
    arcade.draw_text(text='Привет!', start_x=400, start_y=300, font_size=36, align='center')
  File "C:\Program Files\Python38\lib\site-packages\arcade\text_pyglet.py", line 138, in draw_text
    label = pyglet.text.Label(
  File "C:\Program Files\Python38\lib\site-packages\pyglet\text\__init__.py", line 447, in __init__
    super(Label, self).__init__(document, x, y, width, height,
  File "C:\Program Files\Python38\lib\site-packages\pyglet\text\__init__.py", line 268, in __init__
    super(DocumentLabel, self).__init__(document,
  File "C:\Program Files\Python38\lib\site-packages\pyglet\text\layout.py", line 889, in __init__
    self._wrap_lines_invariant()
  File "C:\Program Files\Python38\lib\site-packages\pyglet\text\layout.py", line 1155, in _wrap_lines_invariant
    assert not self._wrap_lines or self._width, \
AssertionError: When the parameters 'multiline' and 'wrap_lines' are True, the parameter 'width' must be a number.

Process finished with exit code 1

Note: Works OK on Arcade 2.5.7 or if I remove align='center'

Python: 3.8
Arcade: 2.6.0
OS: Win 10

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions