How to display images, audio?

cool-dude2
Posted on 2022-05-28 03:30 (edited 2022-05-28 16:51) Link

I'm thinking about making a program in Principia to display images and I once took a class in Python but I'm not a programmer by any means. Do the lua blocks have access to any part of the filesystem or would it be possible to import an image or audio file somehow?

(Avatar)
ROllerozxa
Posted on 2022-06-01 15:13 Link

Principia Lua cannot access the filesystem (at least not in an intentional way), but you can load images as sprites, from an internal sprite canvas each LuaScript object has. There used to be this tool on the official community site written by pajlada that would take an image and convert it into pixel colour data that it draws to the LuaScript's sprite canvas (max. 1024x1024).

I decided to throw it up here if you wanna try it out, but it can be stubborn and hard to use. I'll be working on improving it soon enough though, there's some things I wanna do with it like adding some more information on how to use it, adding settings to configure the sprite size and filtering, etc.