Digital Screen

From Wiremod Wiki
Jump to: navigation, search


Icon tool.png Display Back
Icon function.png Function: Displays a grid based screen with a per pixel drawing functionality.
Icon leftclick.png Primary fire: Spawns a digital screen
Icon rightclick.png Secondary fire: None
Icon reload.png Reload: None
A screen which can display a bitmap images which can be drawn using CPU, GPU or Expression2 gates. In essence much like actual screens. Can use full RGB coloring.

Inputs

  • PixelX - X position on screen to apply change to. (Horizontal)
  • PixelY - Y position on screen to apply change to. (Vertical)
  • PixelG - ?
  • Clk - Apply Changes. (Triggering this input will force screen to read all inputs and do something.
  • FillColor - Specifies color which used on chosen pixel.
  • ClearRow - Clears a row of pixels at specified Y position. (Vertical)
  • ClearCol - Clears a column of pixels at specified X position. (Horizontal)

Outputs

  • Memory - Hi-speed output. Connects to other hi-speed wire devices, such as CPU's and wirelinked Expression 2 gates.

Note: Memory also will output current value written in chosen pixel using PixelX and PixelY inputs.

Notes

Position where X is 0 and Y is 0 is top left of the screen.

Hi-Speed Addresses

0 - 786431 RGB data
1048569 Color mode (Use values below to specify mode)
0: RGBXXX;
1: R G B;
2: R*65536 + G*256 + B;
3: RRRGGGBBB
1048570 Clear row (Y)
1048571 Clear column (X)
1048572 Height (Y)
1048573 Width (X)
1048574 Hardware Clear Screen
1048575 CLK
1048576 Compression (Makes large pixel updates faster. Default is 1)

Hi-Speed Devices Cheat Sheet


Expression Gate 2

Function Returns Description
rgb2digi(V,N) Type-Number.png Takes color and color mode of the screen and returns suitable number to write in to screen cell.


@name Example E2 For Digital Screen By TerraDestroy
@inputs DS:wirelink
@persist Res X Y
if(first()){
function wirelink:initScreen(Res){
This[1048574]=0 #Reset Screen and whatever was on it will be cleared.
This[1048569]=3 #Set color mode to 3
This[1048575]=1 #Apply changes
This[1048572]=Res #Set new resolution on Y (Height)
This[1048573]=Res #Set new resolution on X (Width)
}   
function wirelink:drawPixel(X,Y,Color:vector,Res){
This[X+Y*Res]=rgb2digi(Color,3)
}
Res=32
DS:initScreen(Res)
}
interval(100) #Every 100ms screen will draw new pixel
DS:drawPixel(X,Y,randvec(0,255),Res) #Draws random color in to cell
X++
if(X==32){X=0,Y++} #If X on the edge, go lower
if(Y==32){Y=0} #If Y at the bottom, reset

Select the wire advanced tool, and wire the DS input of the Expression 2 to the digital screen.

Expression2 Digital Screen Help Thread

CPU

Please add example
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Google AdSense