lordmauve/pgzero

Make it possible to inject additional image into image loader cache

Offen

#254 geöffnet am 15.05.2021

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (211 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (608 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Originally created by @jhutar in #232

I have images dirt.png and bush.png and with this I can create temporary image on the fly when starting the game (so my actor do not need to draw two overlapping images when running the game):

import pygame.image
img_dirt = pygame.image.load('images/dirt.png').convert_alpha()
img_bush = pygame.image.load('images/bush_small.png').convert_alpha()
img_dirt.blit(img_bush, (0,0))
images.add('tmp_dirt_with_bush', img_dirt)
my_actor.image = 'tmp_dirt_with_bush'

Please let me know if it makes sense.

Contributor Guide