Api/ApiLib/Surface2: Difference between revisions

From Minux Wiki
Jump to navigation Jump to search
(page created)
 
(added a sneaky link to api page)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
''Created by CrazedProgrammer'' <ref>https://github.com/CrazedProgrammer/Surface2/</ref>
''3rd party [[api]]/utility Created by CrazedProgrammer'' <ref>https://github.com/CrazedProgrammer/Surface2/</ref>


The largest and most versatile graphics API available in APILib. Capable of rendering 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.  
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 <code>*:output()</code> 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.  





Latest revision as of 05:43, 27 September 2024

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")