开发者

pyglet sprite/texture issue: stretched from bottom left

开发者 https://www.devze.com 2023-01-29 06:37 出处:网络
I have a problem with pyglet on one of my notebooks. I\'m working on a relatively complex 2D-Game but it occurs even with the most minimalistic pyglet application you can imagine:

I have a problem with pyglet on one of my notebooks. I'm working on a relatively complex 2D-Game but it occurs even with the most minimalistic pyglet application you can imagine:

import pyglet

if __name__ == '__main__':
    window = pyglet.window.Window(width=100, height=100)
    window.clear()

    ball_img = pyglet.image.load('ball.gif')
    ball = pyglet.sprite.Sprite(ball_img)

    @window.event
    def on_draw():
        ball.draw()

    pyglet.app.run()

It should display an image of a ball like this:

pyglet sprite/texture issue: stretched from bottom left

But what it's drawing is a somehow stretched image:

pyglet sprite/texture issue: stretched from bottom left

If I replace ball.draw() with ball_img.blit(0, 0, 0) it gets rendered as expected.

The notebook is a small Thinkpad X40 running Linux (Intel integrated graphics).

How can such a behaviour be 开发者_如何学编程caused or what is likely to be causing this?


On my laptop (Ubuntu 10.10 with Intel GMA 4500) everything works fine with your code. I just modified the image name and I used a png that I already had on the computer.

0

精彩评论

暂无评论...
验证码 换一张
取 消