Difference between revisions of "CCLights2"
From ComputerCraft Wiki
(Wikilinking properly) |
Magiczocker (Talk | contribs) |
||
Line 17: | Line 17: | ||
The GPU Peripheral needs to be placed next to a computer. It will autoconnect with the first monitor that connects with it, and will auto disconnect when the monitor detaches. | The GPU Peripheral needs to be placed next to a computer. It will autoconnect with the first monitor that connects with it, and will auto disconnect when the monitor detaches. | ||
− | {{Crafting | + | {{Crafting |
|A1=iron ingot |B1=iron ingot |C1=iron ingot | |A1=iron ingot |B1=iron ingot |C1=iron ingot | ||
|A2=Redstone |B2=Gold Ingot |C2=Redstone | |A2=Redstone |B2=Gold Ingot |C2=Redstone | ||
Line 24: | Line 24: | ||
|Output-image=Grid_CCLights2_GPU.png | |Output-image=Grid_CCLights2_GPU.png | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 43: | Line 43: | ||
The basic Monitor. It sports an elegant resolution of 256x144. | The basic Monitor. It sports an elegant resolution of 256x144. | ||
− | {{Crafting | + | {{Crafting |
|A1=iron ingot |B1=iron ingot |C1=iron ingot | |A1=iron ingot |B1=iron ingot |C1=iron ingot | ||
|A2=Redstone |B2=glass pane |C2=Redstone | |A2=Redstone |B2=glass pane |C2=Redstone | ||
Line 49: | Line 49: | ||
|Output=CCLights2 Monitor | |Output=CCLights2 Monitor | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 59: | Line 59: | ||
An external Monitor. It supports a resolution up to 512x288. | An external Monitor. It supports a resolution up to 512x288. | ||
− | {{Crafting | + | {{Crafting |
|A1=glass pane |B1=glass pane |C1=glass pane | |A1=glass pane |B1=glass pane |C1=glass pane | ||
|A2=glass pane |B2=CCLights2 Monitor |C2=glass pane | |A2=glass pane |B2=CCLights2 Monitor |C2=glass pane | ||
Line 66: | Line 66: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
|B2-link=CCLights2 | |B2-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 74: | Line 74: | ||
The basestation for the tablet, CONNECT YOUR TABLETS HERE! | The basestation for the tablet, CONNECT YOUR TABLETS HERE! | ||
− | {{Crafting | + | {{Crafting |
|B1=Redstone | |B1=Redstone | ||
|A2=Redstone |B2=CCLights2 Monitor |C2=Redstone | |A2=Redstone |B2=CCLights2 Monitor |C2=Redstone | ||
Line 81: | Line 81: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
|B2-link=CCLights2 | |B2-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 90: | Line 90: | ||
Yep. You can craft more Ram. | Yep. You can craft more Ram. | ||
− | {{Crafting | + | {{Crafting |
|A1=iron ingot |B1=iron ingot |C1=iron ingot | |A1=iron ingot |B1=iron ingot |C1=iron ingot | ||
|A2=Redstone |C2=Redstone | |A2=Redstone |C2=Redstone | ||
Line 96: | Line 96: | ||
|Output=CCLights2 Ram | |Output=CCLights2 Ram | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 104: | Line 104: | ||
Yep. You can craft more Ram... with ram! (double the capacity up to a maximum of 8k!) | Yep. You can craft more Ram... with ram! (double the capacity up to a maximum of 8k!) | ||
− | {{Crafting | + | {{Crafting |
|A1=CCLights2 Ram |B1=CCLights2 Ram | |A1=CCLights2 Ram |B1=CCLights2 Ram | ||
|Output=CCLights2 Ram | |Output=CCLights2 Ram | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> | ||
Line 117: | Line 117: | ||
Hold it in your hand! Go caving! Watch your life leech away as you stare into this tablet! NOTE: Watch out for Creepers. | Hold it in your hand! Go caving! Watch your life leech away as you stare into this tablet! NOTE: Watch out for Creepers. | ||
− | {{Crafting | + | {{Crafting |
|A1=Gold Ingot |B1=iron ingot |C1=Gold Ingot | |A1=Gold Ingot |B1=iron ingot |C1=Gold Ingot | ||
|A2=Redstone |B2=CCLights2 External Monitor |C2=Redstone | |A2=Redstone |B2=CCLights2 External Monitor |C2=Redstone | ||
Line 124: | Line 124: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
|B2-link=CCLights2 | |B2-link=CCLights2 | ||
− | + | }} | |
</td> | </td> | ||
</tr> | </tr> |
Latest revision as of 06:15, 4 August 2020
CCLights2 is an Open Source Minecraft mod that adds a GPU peripheral, and monitors to suit your need. Unlike CCGPU, this mod does not use OpenGL, but it is Multiplayer Compatible.
Please note; this documentation will always try to stay up to date with the github repo, so it might not fit your build :P
GPU Methods | ||
Returns | Method Name | Description |
nil | gpu.fill() | Fills the current binded texture with the GPU color. NOTE: This method will fully replace the contents of the texture. |
number textureid | gpu.createTexture(number width, number height) | Creates a texture and returns the texture id. This function will error if there is no more room for the texture. |
number freememory | gpu.getFreeMemory() | Returns the amount of free memory that the GPU has to use. This can be expanded by right clicking the GPU with RAM. |
number totalmemory | gpu.getTotalMemory() | Returns the amount of memory that the GPU has. This can be expanded by right clicking the GPU with RAM. |
number usedmemory | gpu.getUsedMemory() | Returns the amount of memory that the GPU is using. This value is changed by allocating textures with gpu.createTexture and freeing textures with gpu.freeTexture. |
nil | gpu.bindTexture(number textureid) | Bind the texture at textureid, this method will error if invalid values are used. Texture 0 is the screen. |
nil | gpu.plot(number x, number y) | Sets the pixel on x,y to the the GPU's current color. (Remember, all drawing command work on the current binded texture) |
nil | gpu.drawTexture(number textureid, number x, number y[, number startX, number startY, number width, number height]) | Draws the texture textureid to x and y, and if startX, startY, width, and height is defined, it will render only that area of the texture. (Remember: You can render the texture to itself) |
nil | gpu.freeTexture(number textureid) | Frees the texture defined by textureid |
nil | gpu.line(number x0, number y0, number x1, number y1) | Draws a line from x0 and y0 to x1 and y1. |
number width, number height | gpu.getSize([ number textureid]) | Returns the texture size of textureid or the current binded texture. Using texture 0 will give you the screen size. |
number red, number green, number blue, number alpha | gpu.getPixels(number x, number y) | Returns the color of the pixel in the currently binded texture. Out of bound pixels have an undefined side effect. |
nil | gpu.rectangle(number x, number y, number width, number height) | Draws the outline of a rectangle from x, y to x+width, y+height. |
nil | gpu.filledRectangle(number x, number y, number width, number height) | Draws a filled rectangle from x, y to x+width, y+height. |
nil | gpu.setColor(number red, number green, number blue[, number alpha]) | Sets the GPU's current drawing color |
number slot | gpu.getBindedTexture() | Gets the GPU's currently binded texture |
nil | gpu.setPixels(number width, number height, number x, number y,number red,number green,number blue,...) | takes an array and writes each pixel to the image. this method is accelerated by java and is faster than multiple gpu.plot calls. |
nil | gpu.flipTextureV() | flips the texture vertically |
numberTextureID, numberWidth, numberHeight | gpu.import(string imagestoredinCC) | decodes an imagefile and makes it ready for texture binding. |
string filedata | gpu.export(number textureid, string file format) | encodes an imagefile and makes it ready for saving. |
nil | gpu.drawText(string text to write, number x,number y) | writes text from pixel x,y |
number textWidth | gpu.getTextWidth() | Gets Text width |
nil | gpu.setColor(number red,number green,number blue, optional; number alpha) | Sets the GPU's current color |
number red, number green, number blue, number alpha | gpu.getColor() | Gets the GPU's current color |
nil | gpu.translate(number x,number y) | translates the texture in two dimensions |
nil | gpu.rotate(number degrees) | rotates the texture in two dimensions |
nil | gpu.rotateAround(number degrees,number x,number y) | rotates the texture around pixel x,y |
nil | gpu.scale(number x-axis size,number y-axis size) | scales the texture to specs |
nil | gpu.push() | store transformation commands from here on and push them to the storestack |
nil | gpu.pop() | process stored transformation input |
table | gpu.getMonitor().getResolution() | Get the monitor resolution w/h |
nil | gpu.blur(number blur amount) | makes the texture blurry |
nil | gpu.startFrame() | Starts a new frame (use this if you plan to draw large amounts of data) |
nil | gpu.endFrame() | ends the frame (ends the frame and sends the data, use this if you plan to draw large amounts of data) |
nil | gpu.clearRect(number x, number y, number width, number height) | Clear rectangle entirely to alpha 255 |
nil | gpu.origin() | Reset RenderPoint with affline transform |
Events | ||
Returns | EventName | Description |
button,x,y, player | monitor_move | The player dragged the mouse while holding in a button |
button,x,y,player | monitor_down | The player began a click on the monitor |
button,x,y,player | monitor_up | The player stopped a click on the monitor |
button,x,y,player | monitor_down | The player began a click on the monitor |
string char | char | The player typed a character |
string key | key | The player mashed the keyboard |
table of imagedata, importable | tablet_image | The player took a picture with the tablet |