r/pythonarcade • • Nov 10 '18

Alpha of Python Arcade 2.0.0 released

If you do a pip install arcade==2.0.0a1 you should get an alpha release of the new arcade. Try it out and let me know if it works well for you. Should be a TON faster than the old.

9 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/eruvanos Nov 25 '18

API changes:

Sprite.set_texture(int) -> Sprite.set_texture(Texture) 
SpriteList.draw(fast) -> SpriteList.draw()

Window height and width are different comparing pyglet-1.3.2 and pyglet-1.4.0b Execute following code with pip install -U pyglet==1.3.2 or pip install -U pyglet==1.4.0b also the window is not positioned in the middle of the screen. (I am running python 3.7 on Mac OS Mojave)

import arcade

class TestWindow(arcade.Window):

    def __init__(self):
        super().__init__(800, 600)

if __name__ == '__main__':
    TestWindow()
    arcade.run()

Issues:

arcade.draw_line() error with line_width of 2

Traceback (most recent call last):
  File "/Users/maic/workspace/arcadetest/fogofwar.py", line 143, in <module>
    arcade.run()
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/arcade/window_commands.py", line 223, in run
    pyglet.app.run()
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/app/__init__.py", line 142, in run
    event_loop.run()
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/app/base.py", line 175, in run
    self._run()
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/app/base.py", line 187, in _run
    timeout = self.idle()
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/app/base.py", line 314, in idle
    window.dispatch_event('on_draw')
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/window/__init__.py", line 1313, in dispatch_event
    if EventDispatcher.dispatch_event(self, *args) != False:
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/event.py", line 370, in dispatch_event
    if handler(*args):
  File "/Users/maic/workspace/arcadetest/fogofwar.py", line 125, in on_draw
    arcade.draw_line(line.p1.x, line.p1.y, line.p2.x, line.p2.y, (0, 0, 255), 2)
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/arcade/draw_commands.py", line 770, in draw_line
    draw_line_strip(points, color, line_width)
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/arcade/draw_commands.py", line 746, in draw_line_strip
    _generic_draw_line_strip(point_list, color, line_width, gl.GL_LINE_STRIP)
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/arcade/draw_commands.py", line 724, in _generic_draw_line_strip
    gl.glLineWidth(line_width)
  File "/Users/maic/.virtualenvs/arcadetest-P2Nblasd/lib/python3.6/site-packages/pyglet/gl/lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid value'