renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
328 stars 65 forks source link

Use image.load for gif #147

Closed BlackRam-oss closed 1 year ago

BlackRam-oss commented 1 year ago

I am trying to load a .git into the game.

I tried with:
pygame.image.load("bomb.gif")
image

(I'm not sure of the path so I experimented a bit but it still didn't work)

anyway the error is this:

OSError: Could not open 'player1.gif': b"Couldn't open player1.gif"

is there another way to do it or am i doing something wrong?

renpytom commented 1 year ago

Yes, you are - you're not using the right path to player1.gif. (Probably.)

This is unlikely to be a bug in pygame_sdl2.

BlackRam-oss commented 1 year ago

Yes, you are - you're not using the right path to player1.gif. (Probably.)

This is unlikely to be a bug in pygame_sdl2.

@renpytom

I also tried images/...gif But it didn't work. While with pygame (original) this worked (images/...gif)

Could you tell me what the path should be? (Do I need to reopen a new issue)?

renpytom commented 1 year ago

I don't support programming in pi game comma but you probably want to use renpy.open_file to gain access to the files data directly.

On Wed Mar 8, 2023, 07:19 AM GMT, Exodia @.***> wrote:

Yes, you are - you're not using the right path to player1.gif. (Probably.)

This is unlikely to be a bug in pygame_sdl2.

I also tried image/...gif But it didn't work. While with pygame (original) this worked (image/...gif)

Could you tell me what the path should be? (Do I need to reopen a new issue)?

— Reply to this email directly, view it on GitHub https://github.com/renpy/pygame_sdl2/issues/147#issuecomment-1459650671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC4XHH2YABDOEKPOERJAF3W3AXG3ANCNFSM6AAAAAAVSWHOGY . You are receiving this because you modified the open/close state.Message ID: @.***>

BlackRam-oss commented 1 year ago

Ok understood, where you can it is better to use the renpy library