This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
_strx's profile picture

litPix - Little Pixels without Limits [v0.8]

Started by _strx, 21 July 2017 - 03:26 PM
_strx #1
Posted 21 July 2017 - 05:26 PM
litPix v0.8


Little Pixels without Limits


litPix (Little Pixels) is an API that can be used to make square pixels in CC, with a normal size of 28x51.

litPix can be used for a plethora of things, like video games and drawing applications. litPix is only in Beta, and is missing features and needs some speed optimization. Unlike the majority of APIs, you must run the API, instead of loading it.


Functions:

litpix.setBackgroundColor(color) - Sets Background Color to color

litpix.clear() - Clear Screen

litpix.drawPixel(x, y, c) - Draws LitPix pixel at x, y

litpix.drawLine(x1, y1, x2, y2, c) - Draws line from x1,y1 to x2,y2 with color c

litpix.drawRect(x1, y1, x2, y2, c, filled) - Draws rectangle with color c, if filled is true it will fill

litpix.drawPoly(x1, y1, x2, y2, x3, y3…, c) - Draws polygon with color c

litpix.createSymbol(table) - Returns LitPix symbol; Table must be a 2 dimensional array; 0 is transparent, 1 is the first color in the pallete, etc…
litpix.createPallete(table) - Returns LitPix pallete; Pallete must be an array

litpix.drawSymbol(x, y, symbol, pallete) - Draws Symbol with Pallete

litpix.push() - Disables Rendering until Pop is executed

litpis.pop() - Render immediately and allow rendering after Push


For more information, look at the Example Program's code. I am working on a Wiki.






Screenshot of Example Program:



Todo:

Todo List
  • Add transformation to Symbols
  • Make litPix faster
  • Color changes


Enjoy!
The Crazy Phoenix #2
Posted 24 July 2017 - 04:41 PM
You can use "term.getSize" to get the size of the display. That will allow your program to work correctly on customized computers, pocket computers and monitors.
_strx #3
Posted 01 August 2017 - 12:30 AM
You can use "term.getSize" to get the size of the display. That will allow your program to work correctly on customized computers, pocket computers and monitors.

EDIT: Yeah I'll try to fix that. Sorry.
Edited on 29 October 2017 - 05:52 PM
The Crazy Phoenix #4
Posted 01 August 2017 - 12:48 AM
You can use "term.getSize" to get the size of the display. That will allow your program to work correctly on customized computers, pocket computers and monitors.

And you think I don't know that?

I was pointing it out because you hard-coded the screen dimensions into your API.
CLNinja #5
Posted 01 August 2017 - 02:00 AM
You can use "term.getSize" to get the size of the display. That will allow your program to work correctly on customized computers, pocket computers and monitors.

And you think I don't know that?
He was stating the fact that you hard coded your values, and was letting you know term.getSize is a function. No need to be so snappy.
_strx #6
Posted 01 August 2017 - 10:37 PM
You can use "term.getSize" to get the size of the display. That will allow your program to work correctly on customized computers, pocket computers and monitors.

And you think I don't know that?
He was stating the fact that you hard coded your values, and was letting you know term.getSize is a function. No need to be so snappy.

I know that I hard coded my values, it wasn't intended to be released and I just had a quick thought of doing it.