Content added Content deleted
No edit summary |
(fix english) |
||
Line 46: | Line 46: | ||
{{#invoke:GetPartInfo|getField|Description}} |
{{#invoke:GetPartInfo|getField|Description}} |
||
==Gallery== |
==Gallery== |
||
[[File:DisplayScreen2.jpg|300px|thumb|left|A Screen emits |
[[File:DisplayScreen2.jpg|300px|thumb|left|A Screen emits light at Night, Similar to [[Light]] and [[Spotlight]]]] |
||
[[Category:Parts]] |
[[Category:Parts]] |
Revision as of 02:47, 13 February 2022
The screen is a part used to display information from Microcontrollers and Cameras.
Programming
The screen contains 3 programmable functions.
- Screen:CreateElement(GUIClassName, Properties)
- Screen:ClearElements(), which clears all elements from the screen
- ScreenObject:ChangeProperties(Properties)
Examples
The following is an example that will create a TextLabel displaying "Hello, world!", waiting 5 seconds, then saying "Goodbye, world!", clearing the screen after 2.5 seconds
local Screen = GetPartFromPort(1, 'Screen') -- assigning the screen on port 1 to a variable
Screen:ClearElements() -- clear all elements already on the screen so there arent any old elements on it
local TextLabel = Screen:CreateElement('TextLabel', {
AnchorPoint = Vector2.new(0.5, 0.5);
Position = UDim2.fromScale(0.5, 0.5);
Size = UDim2.fromScale(1, 1);
Text = 'Hello, world!';
TextSize = 20;
TextScaled = false;
})
wait(5)
TextLabel:ChangeProperties({ -- change the text and size
Text = 'Goodbye, world!';
TextSize = 25
})
wait(2.5)
Screen:ClearElements() -- remove everything from the screen
Description
"A programmable object capable of showing text, buttons and images on an LED display. Very useful for creating custom programmable interfaces. "
Gallery
![](http://static.miraheze.org/wasteofspacewiki/thumb/a/a1/DisplayScreen2.jpg/300px-DisplayScreen2.jpg)