Now that the next phase of the contest has started, I guess it's worth mentioning that we are going to open source much, possibly all, of our KidPaint app. At a bare minimum, we'll be releasing the back-end libraries that we wrote.
Here's our current list:
- rdBitWise.brs - Some missing BrightScript core ops, such as right shift and xor
- rdByteArray.brs - Extra ByteArray functions, such as BAcopy, BAtoINT, INTtoBA, INTtoHEX, BAtoSTR
- rdCRC.brs - Standard CRC32 Cyclic Redundancy Check computation
- rdPNG.brs - Load color indexed PNG file and change palette color and transparency values
- rdTempfile.brs - Temporary filename creator, guarantees returned name is unique
- rdLine.brs - Create ImageCanvas ready line object of arbitrary color when provided two points
- rdShape.brs - Create ImageCanvas ready shape object of arbitrary color scaled and rotated
- rdConsole.brs - ImageCanvas based console with up/down automatic scrolling and specifiable number of visible messages
- rdFunctional.brs - Functional programming methods/functions such as map and apply
- rdDebug.brs - Dump (almost) any data to debug console, including deep data structures
- rdBRS.brs - Convert data structure into BrightScript compatible string capable of being eval'ed (for serialization)
The goal of this is to extend BrightScript and the existing component library in the common areas that are redone by many developers. By making it open source and easily accessible (Github or something similar), we increase it's use, which we hope will encourage contribution. We would be very happy to merge in the helper functions and general classes other Roku developers have created, so that we can create one "community standard library" that everyone can share and rely on.
Currently, we are calling it "librokudev", and all files within and classes/functions exported should begin with "rd" to prevent namespace conflicts as much as possible with any app it might be included in (with the possible exception of low-level functions such "xor", for which the "rd" prefix may not make sense).
Notes:
- rdShape should be abstracted to rdPNGImage or something similar, as it requires PNG images to work on in it's current form. An alternate rdShape utilizing rdLine is a possibility.
- rdDebug isn't quite a print anything tool yet, but I have thoughts on how to GREATLY simplify it, and some common programming techniques in BrightScript in general through a general boxing function.
- rdBRS isn't quite complete, but is mostly done (we didn't quite finish it by the contest deadline).
- rdPNG does allow arbitrary color and transparency pixel manipulation, but should be extended to be more robust and easily support multiple color/transparency pixels (very simple).
Everything else listed is functional and works as advertised. These are in use in our KidPaint channel -- for example, we allow choosing colors for the shapes, but we only include a single filled and outlined version of each shape in black, and dynamically create new PNGs in tmp:/ with the correct color palette entry as needed. We only included a set number of colors in the application for simplicity and because of time constraints, not technical limitations; an arbitrary color picker is planned for the future. Of course, much of this wouldn't be required with drawing primitives built in .... *cough* *cough*
🙂-- Team GandK
-- GandK Labs
Check out Reversi! in the channel store!