Api/ApiLib/Surface2

From Minux Wiki
Revision as of 05:43, 27 September 2024 by Shorun (talk | contribs) (added a sneaky link to api page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

3rd party api/utility Created by CrazedProgrammer [1]

The largest and most versatile graphics API available in APILib. Capable of rendering primitive shapes, text and images (namely .NFP, .NFT, .RIF, and 24-bit .BMP) to a buffer which can then be displayed on the terminal or external monitor(s). Cross-compatible with other APIs that render text and images (like cPrint, for instance), as long as the Surface2 buffer has been made visible using *:output() first. Among other things, it also has transparency, clipping support, and is capable of utilizing custom drawn fonts. Most projects, no matter how small and large, can benefit from the GUI-building features that Surface2 offers.


Usage Example:

local surface = dofile(surfacepath)
local surf = surface.create(51, 19, colors.blue)
surf:drawString("Hello!", 2, 1, nil, colors.yellow)
surf:output()
os.pullEvent("mouse_click")