×
Create a new article
Write your page title here:
We currently have 276 articles on Waste Of Space Wiki. Type your article name above or create one of the articles listed here!



    Waste Of Space Wiki

    Screen: Difference between revisions

    Content added Content deleted
    (fix english)
    m (Set TextLabel link to their new documentation page equivalent)
     
    Line 20: Line 20:


    === Examples ===
    === Examples ===
    The following is an example that will create a [https://developer.roblox.com/en-us/api-reference/class/TextLabel TextLabel] displaying "Hello, world!", waiting 5 seconds, then saying "Goodbye, world!", clearing the screen after 2.5 seconds<syntaxhighlight lang="lua" line="1">
    The following is an example that will create a [https://create.roblox.com/docs/reference/engine/classes/TextLabel TextLabel] displaying "Hello, world!", waiting 5 seconds, then saying "Goodbye, world!", clearing the screen after 2.5 seconds<syntaxhighlight lang="lua" line="1">
    local Screen = GetPartFromPort(1, 'Screen') -- assigning the screen on port 1 to a variable
    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
    Screen:ClearElements() -- clear all elements already on the screen so there arent any old elements on it

    Latest revision as of 10:51, 25 August 2022

    The screen is a part used to display information from Microcontrollers and Cameras.

    Programming[edit | hide all | hide | edit source]

    The screen contains 3 programmable functions.

    • Screen:CreateElement(GUIClassName, Properties)
    • Screen:ClearElements(), which clears all elements from the screen
    • ScreenObject:ChangeProperties(Properties)

    Examples[edit | hide | edit source]

    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[edit | hide | edit source]

    "A programmable object capable of showing text, buttons and images on an LED display. Very useful for creating custom programmable interfaces. "

    Gallery[edit | hide | edit source]

    A Screen emits light at Night, Similar to Light and Spotlight
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.

    Recent changes

  • Axenori • 3 days ago
  • Voivsone • 4 days ago
  • Axenori • 4 days ago
  • Axenori • 5 days ago
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies.