Hello, I’m try to add a simple sprite to the screen, but have no clou how to fill the call for the sprite.
Please need some help to get running this simple program.
Thanks for Anuy help.
Cheers, Jan
import gc
import pngdec
from presto import Presto
from picographics import PicoGraphics, DISPLAY_PRESTO_FULL_RES, PEN_RGB565
# --- Init ---
presto = Presto(full_res=True)
display = presto.display
WIDTH, HEIGHT = 480, 480
PNG_W, PNG_H = 70, 70
PNG_PATH = "/sd/zon_70x70.png"
# Sprite-buffer met expliciete pen_type en afmetingen
sprite = PicoGraphics(width=PNG_W, height=PNG_H)
png = pngdec.PNG(sprite)
png.open_file(PNG_PATH)
png.decode()
gc.collect()
BG = display.create_pen(0, 0, 32)
display.set_pen(BG)
display.clear()
x = (WIDTH - PNG_W) // 2
y = (HEIGHT - PNG_H) // 2
display.blit(sprite, x, y)
presto.update()