Home

Awesome

<img src="./assets/logo.png" width="50"></img> Pixelbox modules

Hopefully soon to be growing collection of modules and tools to be loading and used with pixelbox_lite

Developing modules

Check DEV.md for explanations of arguments, return values, and callbacks.

Module index

How to load pixelbox modules?

Pixelbox provides two ways to load modules, those are

Loading on creation

You can simply use of the third argument of pixelbox.new, this argument takes in a table of modules (and load settings, more info around here)

This would look something like this

local box = require("pixelbox_lite").new(term.current(),nil,{
    require("pb_modules/module1"),
    require("pb_modules/module2"),
    require("pb_modules/module3"),

    force   = false,
    supress = false,
})

Loading on "runtime"

In case you want to split loading up or you want to load more modules later on, you can do so using the load_modules function, this function takes in just a single argument which acts identical to pixelbox.news third argument, it just takes a list of plugins and flags and loads them in order. More info can again be found here here)

Usage of this might look something like this

local box = require("pixelbox_lite").new(term.current())

box:load_modules{
    require("pb_modules/module1"),
    require("pb_modules/module2"),
    require("pb_modules/module3"),

    force   = false,
    supress = false,
}

Notes around loading modules

Modules

[PixelBox GraphicsRender]

Redirects the pixelbox :draw() call to CraftOS PCs graphics mode

Usecase: Testing how programs run at higher resolutions

Notes:

- id:   PB_MODULE:gfxrnd
- name: PB_GFXRender

[PixelBox Analyzer]

Adds an analyze_buffer function which sanity checks buffer data

Usecase: Debugging potentially weird/internal errors thrown by pixelbox

Methods:

- id:   PB_MODULE:analyzer
- name: PB_Analyzer