Log In  


I am trying to edit sprites at runtime (using a sprite to store a large map), I know the sprites can be resized and from what I can tell the limit is 512 pixels in dimension?

I managed to draw to the sprite using set_draw_target() and then pset to draw the pixels I want, but I can't figure out how to then read the pixels! The guide mentions sset and sget which I know from pico8 but I can't make them work for some reason, I figured maybe I need to return the sprite as a user data with get_sprite but then sget doesn't seem to be a function of user data and can't find anywhere that explains how to use sget and sset.

Also I know the sprites will reset when the game is run so how would I then overwrite the sprite with the edited version so I can save the generated map?



I was wondering the same thing. Sset and sget are in the picotron user manual, but in picotron they aren't highlighted as valid functions.


2

sprites are just userdata, so you can do :get and :set on them.


sget & sset are for interacting with the spritesheet, I don't think you can use them for editing a userdata: https://www.lexaloffle.com/dl/docs/picotron_manual.html#sget

Soupster is correct 🫡
I suggest you read the userdata section in the docs: https://www.lexaloffle.com/dl/docs/picotron_manual.html#Userdata


Thank you Soupster, that makes so much more sense :)



[Please log in to post a comment]