Difference between revisions of "CCLights2"
From ComputerCraft Wiki
(Changing int to number. Why the hell so many damned links to int????) |
(Halfway finished rewriting this page.) |
||
Line 2: | Line 2: | ||
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | <table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | ||
− | <tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"> | + | <tr> |
− | [[File:Grid_disk.png|24px]] | + | <td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">[[File:Grid_disk.png|24px]] CCLights2 Peripherals</td> |
− | CCLights2 Peripherals | + | </tr> |
− | </td></tr> | + | <tr> |
+ | <td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Name</td> | ||
+ | <td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td> | ||
+ | </tr> | ||
− | + | <tr style="background-color: #FFFFFF;"> | |
− | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">GPU Peripheral</td> | |
− | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">GPU Peripheral</td> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | |
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. | ||
Line 22: | Line 24: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
}} | }} | ||
− | + | </td> | |
+ | </tr> | ||
− | <tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"> | + | <tr> |
− | [[File:Grid_disk.png|24px]] | + | <td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">[[File:Grid_disk.png|24px]] CCLights2 Monitors</td> |
− | CCLights2 Monitors | + | </tr> |
− | </td></tr> | + | |
− | <tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr> | + | <tr> |
+ | <td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Name</td> | ||
+ | <td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td> | ||
+ | </tr> | ||
− | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">Normal Monitor</td> | + | <tr style="background-color: #E8E8E8;"> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Normal Monitor</td> |
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | ||
The basic Monitor. It sports an elegant resolution of 256x144. | The basic Monitor. It sports an elegant resolution of 256x144. | ||
Line 43: | Line 49: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
}} | }} | ||
− | + | </td> | |
+ | </tr> | ||
− | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">External Monitor</td> | + | <tr style="background-color: #FFFFFF;"> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">External Monitor</td> |
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | ||
An external Monitor. It suports a resolution up to 512x288. | An external Monitor. It suports a resolution up to 512x288. | ||
Line 58: | Line 66: | ||
|B2-link=CCLights2 | |B2-link=CCLights2 | ||
}} | }} | ||
− | + | </td> | |
+ | </tr> | ||
− | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">RAM</td> | + | <tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">RAM</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> |
Yep. You can craft more Ram. | Yep. You can craft more Ram. | ||
Line 72: | Line 81: | ||
|Output-link=CCLights2 | |Output-link=CCLights2 | ||
}} | }} | ||
− | + | </td> | |
+ | </tr> | ||
− | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">Tablet</td> | + | <tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">Tablet</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> |
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. | ||
Line 87: | Line 97: | ||
|B2-link=CCLights2 | |B2-link=CCLights2 | ||
}} | }} | ||
− | + | </td> | |
+ | </tr> | ||
+ | </table> | ||
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | <table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"> | ||
− | <tr><td colspan="3" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"> | + | <tr> |
− | [[File:Grid_disk.png|24px]] | + | <td colspan="3" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">[[File:Grid_disk.png|24px]] GPU Methods</td> |
− | GPU Methods | + | </tr> |
− | </td | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | <tr | + | <tr> |
− | <td style=" | + | <td style="width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;">Returns</td> |
− | <td style=" | + | <td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td> |
+ | <td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td> | ||
+ | </tr> | ||
− | <tr style="background-color: # | + | <tr style="background-color: #FFFFFF;"> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">( | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> |
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;"> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setColor({{type|number}} red, {{type|number}} green, {{type|number}} blue[, {{type|number}} alpha])</td> |
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the GPU's current drawing color</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.fill()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Fills the current binded texture with the GPU color. NOTE: This method will fully replace the contents of the texture.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} textureid</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.createTexture({{type|number}} width, {{type|number}} height)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Creates a texture and returns the texture id. This function will error if there is no more room for the texture.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} freememory</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getFreeMemory()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of free memory that the GPU has to use. This can be expanded by right clicking the GPU with RAM.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} totalmemory</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getTotalMemory()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of memory that the GPU has. This can be expanded by right clicking the GPU with RAM.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} usedmemory</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getUsedMemory()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">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.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.bindTexture({{type|number}} textureid)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Bind the texture at textureid, this method will error if invalid values are used. Texture 0 is the screen.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setColorRGB({{type|number}} x, {{type|number}} y) and gpu.plot({{type|number}} x, {{type|number}} y)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the pixel at x and y to the the GPU's current color. (Remember, all drawing command work on the current binded texture)</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.drawTexture({{type|number}} textureid, {{type|number}} x, {{type|number}} y[, {{type|number}} startX, {{type|number}} startY, {{type|number}} width, {{type|number}} height])</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws the texture <var>textureid</var> 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)</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.freeTexture({{type|number}} textureid)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Frees the texture defined by <var>textureid</var></td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.line({{type|number}} x0, {{type|number}} y0, {{type|number}} x1, {{type|number}} y1)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a line from x0 and y0 to x1 and y1.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} width, {{type|number}} height</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">(gpu.getSize and gpu.getTextureSize)([ {{type|number}} textureid])</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the texture size of <var>textureid</var> or the current binded texture. Using texture 0 will give you the screen size.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setTransparent()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">This method is depreciated. Any attempt to use it will result in an error.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setTransparencyColor()</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">This method is depreciated. Any attempt to use it will result in an error.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} red, {{type|number}} green, {{type|number}} blue, {{type|number}} alpha</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getColorRGB({{type|number}} x, {{type|number}} y) and gpu.getPixel({{type|number}} x, {{type|number}} y)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the color of the pixel in the currently binded texture. Out of bound pixels have an undefined side effect.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.rectangle({{type|number}} x, {{type|number}} y, {{type|number}} width, {{type|number}} height)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws the outline of a rectangle from x, y to x+width, y+height.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.filledRectangle({{type|number}} x, {{type|number}} y, {{type|number}} width, {{type|number}} height)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a filled rectangle from x, y to x+width, y+height.</td> | ||
+ | </tr> | ||
</table> | </table> | ||
[[Category:User Created Peripherals]] | [[Category:User Created Peripherals]] |
Revision as of 12:07, 22 December 2013
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.
GPU Methods | ||
Returns | Method Name | Description |
nil | gpu.setColor(number red, number green, number blue[, number alpha]) | Sets the GPU's current drawing color |
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.setColorRGB(number x, number y) and gpu.plot(number x, number y) | Sets the pixel at x and 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 and gpu.getTextureSize)([ number textureid]) | Returns the texture size of textureid or the current binded texture. Using texture 0 will give you the screen size. |
nil | gpu.setTransparent() | This method is depreciated. Any attempt to use it will result in an error. |
nil | gpu.setTransparencyColor() | This method is depreciated. Any attempt to use it will result in an error. |
number red, number green, number blue, number alpha | gpu.getColorRGB(number x, number y) and gpu.getPixel(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. |