Libraries.Robots.Lego.Screen Documentation

This class is an object representation of a LEGO Mindstorms EV3 LCD screen. It is used to display text and shapes on the screen. When using coordinates, the origin (0, 0) represents the bottom-left corner of the screen.

Example Code

use Libraries.Robots.Lego.Screen
use Libraries.Robots.Lego.Button

class Main
    action Main
        Button button
        Screen screen

        screen:DrawRectangleFull(40, 80, 20, 20)
        screen:DrawRectangleFull(116, 80, 20, 20)
        screen:DrawLine(40, 40, 136, 40)
        screen:DrawLine(40, 40, 40, 50)
        screen:DrawLine(136, 40, 136, 50)
        button:WaitForButtonPress()
    end
end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Clear()This action removes everything from the screen.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns a CompareResult.
DrawCircleFull(integer x, integer y, integer radius)This action draws a full circle on the screen.
DrawCircleOutline(integer x, integer y, integer radius)This action draws a circle outline on the screen.
DrawEllipseFull(integer x, integer y, integer width, integer height)This action draws a filled ellipse on the screen.
DrawEllipseOutline(integer x, integer y, integer width, integer height)This action draws an ellipse outline on the screen.
DrawLine(integer xStart, integer yStart, integer xEnd, integer yEnd)This action draws a line on the screen.
DrawPixel(integer x, integer y)This action places a pixel on the screen
DrawRectangleFull(integer xBottomLeft, integer yBottomLeft, integer width, integer height)This action draws a filled in rectangle on screen.
DrawRectangleOutline(integer xBottomLeft, integer yBottomLeft, integer width, integer height)This action draws an outline of a rectangle on the screen.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
EraseCircleFull(integer x, integer y, integer radius)This action erases pixels in the shape of a full circle from the screen.
EraseCircleOutline(integer x, integer y, integer radius)This action erases pixels in the shape of a circle outline from the screen.
EraseEllipseFull(integer x, integer y, integer width, integer height)This action erases a pixels in the shape of a filled ellipse from the screen.
EraseEllipseOutline(integer x, integer y, integer width, integer height)This action erases pixels in the shape of an ellipse outline from the screen.
ErasePixel(integer x, integer y)This action removes a single pixel from the screen.
EraseRectangleFull(integer xBottomLeft, integer yBottomLeft, integer width, integer height)This action erases pixels in the shape of a full rectangle from the screen.
EraseRectangleOutline(integer xBottomLeft, integer yBottomLeft, integer width, integer height)This action erases pixels in the shape of a rectangle outline from the screen.
GetHashCode()This action gets the hash code for an object.
Output(text message, integer line, integer indent)This action displays a text message on a specific line of the screen with an indentation.
Output(text message, integer line)This action displays a text message on a specific line of the screen.
OutputCenter(text message, integer line)This action displays a centered text message on a specified text line of the screen
OutputCenterLarge(text message, integer line)This action displays a centered large text message, with each character's height spanning two text lines.
OutputInvertedColor(text message, integer line)This action displays a message using inverted pixel colors.
OutputInvertedColor(text message, integer line, integer indent)This action displays a message using inverted pixel colors.
OutputLarge(text message, integer line)This action displays a large text message, with each character's height spanning two text lines.
OutputLarge(text message, integer line, integer indent)This action displays a large text message, with each character's height spanning two text lines.
ScrollUp(text message)This action moves everything on the screen up by one text line and then places a message on the bottom line.
ScrollUp(integer lines)This action scrolls up an amount of text lines based on the passed parameter.
ScrollUp()This action moves everything on the screen up by one text line.

Actions Documentation

Clear()

This action removes everything from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    screen:DrawCircleFull(50, 50, 30)
    button:WaitForButtonPress()
    screen:Output("Hello!", 0)
    button:WaitForButtonPress()
    screen:Clear()      //removes anything on the screen
    screen:OutputCenter("Cleared!", 3)
    button:WaitForButtonPress()

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns a CompareResult. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.

Example Code

use Libraries.Language.Support.CompareResult
        Object o
        Object t
        CompareResult result = o:Compare(t)

Parameters

Return

Libraries.Language.Support.CompareResult: The Compare result, Smaller, Equal, or Larger.

DrawCircleFull(integer x, integer y, integer radius)

This action draws a full circle on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Button button
    Screen screen

    screen:DrawCircleFull(50, 80, 20)      //draw left eye
    screen:DrawCircleFull(126, 80, 20)     //draw right eye

    repeat 3 times
        screen:EraseEllipseFull(50, 120, 20, 10)    //erase previous left eyebrow
        screen:EraseEllipseFull(126, 120, 20, 10)   //erase previous right eyebrow
        screen:EraseCircleFull(86, 40, 25)          //erase previous mouth
        screen:DrawEllipseFull(50, 110, 20, 10)     //draw new left eyebrow
        screen:DrawEllipseFull(126, 110, 20, 10)    //draw new right eyebrow
        screen:DrawCircleFull(86, 40, 15)           //draw new mouth
        button:WaitForButtonPress()                 //toggle the face

        screen:EraseEllipseFull(50, 110, 20, 10)    //erase previous left eyebrow
        screen:EraseEllipseFull(126, 110, 20, 10)   //erase previous right eyebrow
        screen:EraseCircleFull(86, 40, 15)          //erase previous mouth
        screen:DrawEllipseFull(50, 120, 20, 10)     //draw new left eyebrow
        screen:DrawEllipseFull(126, 120, 20, 10)    //draw new right eyebrow
        screen:DrawCircleFull(86, 40, 25)           //draw new mouth
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

DrawCircleOutline(integer x, integer y, integer radius)

This action draws a circle outline on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button

    screen:DrawCircleOutline(89, 64, 20) //circle's center is at 89, 64 with a radius of 20
    utility:DelayMilliseconds(500)
    screen:DrawCircleOutline(89, 64, 30)
    utility:DelayMilliseconds(500)
    screen:DrawCircleOutline(89, 64, 40)
    button:WaitForButtonPress()

Parameters

DrawEllipseFull(integer x, integer y, integer width, integer height)

This action draws a filled ellipse on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Button button
    Screen screen

    screen:DrawEllipseFull(50, 80, 20, 20)      //draw left eye
    screen:DrawEllipseFull(126, 80, 20, 20)     //draw right eye

    repeat 3 times
        screen:EraseEllipseFull(50, 115, 20, 10)    //erase previous left eyebrow
        screen:EraseEllipseFull(126, 115, 20, 10)   //erase previous right eyebrow
        screen:EraseEllipseFull(88, 35, 96, 30)     //erase previous mouth
        screen:DrawEllipseFull(50, 105, 20, 10)     //draw new left eyebrow
        screen:DrawEllipseFull(126, 105, 20, 10)    //draw new right eyebrow
        screen:DrawEllipseFull(88, 35, 96, 10)      //draw new mouth
        button:WaitForButtonPress()                 //toggle the face

        screen:EraseEllipseFull(50, 105, 20, 10)    //erase previous left eyebrow
        screen:EraseEllipseFull(126, 105, 20, 10)   //erase previous right eyebrow
        screen:EraseEllipseFull(88, 35, 96, 10)     //erase previous mouth
        screen:DrawEllipseFull(50, 115, 20, 10)     //draw new left eyebrow
        screen:DrawEllipseFull(126, 115, 20, 10)    //draw new right eyebrow
        screen:DrawEllipseFull(88, 35, 96, 30)      //draw new mouth
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

DrawEllipseOutline(integer x, integer y, integer width, integer height)

This action draws an ellipse outline on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button

    screen:DrawEllipseOutline(89, 64, 20, 10) //ellipse's center is at 89, 64 with a width of 20 and height of 10
    utility:DelayMilliseconds(500)
    screen:DrawEllipseOutline(89, 64, 40, 20)
    utility:DelayMilliseconds(500)
    screen:DrawEllipseOutline(89, 64, 60, 30)
    utility:DelayMilliseconds(500)
    screen:DrawEllipseOutline(89, 64, 80, 40)
    utility:DelayMilliseconds(500)
    screen:DrawEllipseOutline(89, 64, 100, 50)
    button:WaitForButtonPress()

Parameters

DrawLine(integer xStart, integer yStart, integer xEnd, integer yEnd)

This action draws a line on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button

    screen:DrawLine(30, 30, 89, 98)
    utility:DelayMilliseconds(500)
    screen:DrawLine(89, 98, 148, 30)
    utility:DelayMilliseconds(500)
    screen:DrawLine(148, 30, 30, 30)
    button:WaitForButtonPress()

Parameters

DrawPixel(integer x, integer y)

This action places a pixel on the screen

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    Utility utility
    
    integer y = 0
    repeat while y <= 127 //top of the screen
        integer x = 0
        repeat while x <= 177 //right side of the screen
            screen:DrawPixel(x, y)
            utility:DelayMilliseconds(1)
            x = x + 1
        end
        y = y + 1
    end

Parameters

DrawRectangleFull(integer xBottomLeft, integer yBottomLeft, integer width, integer height)

This action draws a filled in rectangle on screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Button button
    Screen screen
    
    screen:DrawRectangleFull(40, 80, 20, 20)    //draw left eye
    screen:DrawRectangleFull(116, 80, 20, 20)   //draw right eye

    repeat 3 times
        screen:EraseRectangleFull(40, 120, 20, 10)  //erase previous left eyebrow
        screen:EraseRectangleFull(116, 120, 20, 10) //erase previous right eyebrow
        screen:EraseRectangleFull(40, 30, 96, 30)   //erase previous mouth
        screen:DrawRectangleFull(40, 110, 20, 10)   //draw new left eyebrow
        screen:DrawRectangleFull(116, 110, 20, 10)  //draw new right eyebrow
        screen:DrawRectangleFull(40, 40, 96, 10)    //draw new mouth
        button:WaitForButtonPress()                 //toggle the face

        screen:EraseRectangleFull(40, 110, 20, 10)  //erase previous left eyebrow
        screen:EraseRectangleFull(116, 110, 20, 10) //erase previous right eyebrow
        screen:EraseRectangleFull(40, 40, 96, 10)   //erase previous mouth
        screen:DrawRectangleFull(40, 120, 20, 10)   //draw new left eyebrow
        screen:DrawRectangleFull(116, 120, 20, 10)  //draw new right eyebrow
        screen:DrawRectangleFull(40, 30, 96, 30)    //draw new mouth
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

DrawRectangleOutline(integer xBottomLeft, integer yBottomLeft, integer width, integer height)

This action draws an outline of a rectangle on the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button

    screen:DrawRectangleOutline(30, 30, 118, 68)    //rectangle's bottom left corner is 30, 30 with a width of 118 and height of 68
    utility:DelayMilliseconds(500)
    screen:DrawRectangleOutline(40, 40, 98, 48)     //a smaller rectangle
    utility:DelayMilliseconds(500)
    screen:DrawRectangleOutline(50, 50, 78, 28)     //an even smaller rectangle
    button:WaitForButtonPress()

Parameters

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

EraseCircleFull(integer x, integer y, integer radius)

This action erases pixels in the shape of a full circle from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Button button
    Screen screen
    
    screen:DrawRectangleFull(0, 0, 177, 127)    //make the screen black
    screen:EraseCircleFull(50, 80, 20)          //erase a left eye from screen
    screen:EraseCircleFull(126, 80, 20)         //erase a right eye from screen

    repeat 3 times
        screen:DrawEllipseFull(50, 120, 20, 10)     //fill in previous left eyebrow
        screen:DrawEllipseFull(126, 120, 20, 10)    //fill in previous right eyebrow
        screen:DrawCircleFull(86, 40, 25)           //fill in previous mouth
        screen:EraseEllipseFull(50, 110, 20, 10)    //erase new left eyebrow from screen
        screen:EraseEllipseFull(126, 110, 20, 10)   //erase new right eyebrow from screen
        screen:EraseCircleFull(86, 40, 15)          //erase new mouth from screen
        button:WaitForButtonPress()                 //toggle the face

        screen:DrawEllipseFull(50, 110, 20, 10)     //fill in previous left eyebrow
        screen:DrawEllipseFull(126, 110, 20, 10)    //fill in previous right eyebrow
        screen:DrawCircleFull(86, 40, 15)           //fill in previous mouth
        screen:EraseEllipseFull(50, 120, 20, 10)    //erase new left eyebrow from screen
        screen:EraseEllipseFull(126, 120, 20, 10)   //erase new right eyebrow from screen
        screen:EraseCircleFull(86, 40, 25)          //erase new mouth from screen
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

EraseCircleOutline(integer x, integer y, integer radius)

This action erases pixels in the shape of a circle outline from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button
    
    screen:DrawRectangleFull(0, 0, 177, 127)    //makes the screen black
    screen:EraseCircleOutline(89, 64, 20)       //circle's center is at 89, 64 with a radius of 20
    utility:DelayMilliseconds(500)
    screen:EraseCircleOutline(89, 64, 30)
    utility:DelayMilliseconds(500)
    screen:EraseCircleOutline(89, 64, 40)
    button:WaitForButtonPress()

Parameters

EraseEllipseFull(integer x, integer y, integer width, integer height)

This action erases a pixels in the shape of a filled ellipse from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Button button
    Screen screen
    
    screen:DrawRectangleFull(0, 0, 177, 127)    //make the screen black
    screen:EraseEllipseFull(50, 80, 20, 20)     //erase a left eye from the screen
    screen:EraseEllipseFull(126, 80, 20, 20)    //erase a right eye from the screen

    repeat 3 times
        screen:DrawEllipseFull(50, 115, 20, 10)     //fill in previous left eyebrow
        screen:DrawEllipseFull(126, 115, 20, 10)    //fill in previous right eyebrow
        screen:DrawEllipseFull(88, 35, 96, 30)      //fill in previous mouth
        screen:EraseEllipseFull(50, 105, 20, 10)    //erase a new left eyebrow from the screen
        screen:EraseEllipseFull(126, 105, 20, 10)   //erase a new right eyebrow from the screen
        screen:EraseEllipseFull(88, 35, 96, 10)     //erase a new mouth from the screen
        button:WaitForButtonPress()                 //toggle the face

        screen:DrawEllipseFull(50, 105, 20, 10)     //fill in previous left eyebrow
        screen:DrawEllipseFull(126, 105, 20, 10)    //fill in previous right eyebrow
        screen:DrawEllipseFull(88, 35, 96, 10)      //fill in previous mouth
        screen:EraseEllipseFull(50, 115, 20, 10)    //erase a new left eyebrow from the screen
        screen:EraseEllipseFull(126, 115, 20, 10)   //erase a new right eyebrow from the screen
        screen:EraseEllipseFull(88, 35, 96, 30)     //erase a new mouth from the screen
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

EraseEllipseOutline(integer x, integer y, integer width, integer height)

This action erases pixels in the shape of an ellipse outline from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button

    screen:DrawRectangleFull(0, 0, 177, 127)    //make the screen black
    screen:EraseEllipseOutline(89, 64, 20, 10) //ellipse's center is at 89, 64 with a width of 20 and height of 10
    utility:DelayMilliseconds(500)
    screen:EraseEllipseOutline(89, 64, 40, 20)
    utility:DelayMilliseconds(500)
    screen:EraseEllipseOutline(89, 64, 60, 30)
    utility:DelayMilliseconds(500)
    screen:EraseEllipseOutline(89, 64, 80, 40)
    utility:DelayMilliseconds(500)
    screen:EraseEllipseOutline(89, 64, 100, 50)
    button:WaitForButtonPress()

Parameters

ErasePixel(integer x, integer y)

This action removes a single pixel from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    screen:DrawCircleFull(50, 50, 25)
    screen:ErasePixel(50, 50)   //removes the center pixel of the circle
    screen:ErasePixel(51, 51)
    screen:ErasePixel(49, 49)
    screen:ErasePixel(51, 49)
    screen:ErasePixel(49, 51)
    button:WaitForButtonPress()

Parameters

EraseRectangleFull(integer xBottomLeft, integer yBottomLeft, integer width, integer height)

This action erases pixels in the shape of a full rectangle from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    screen:DrawRectangleFull(0, 0, 177, 127)    //make the screen black
    screen:EraseRectangleFull(40, 80, 20, 20)    //draw left eye
    screen:EraseRectangleFull(116, 80, 20, 20)   //draw right eye

    repeat 3 times
        screen:DrawRectangleFull(40, 120, 20, 10)  //erase previous left eyebrow
        screen:DrawRectangleFull(116, 120, 20, 10) //erase previous right eyebrow
        screen:DrawRectangleFull(40, 30, 96, 30)   //erase previous mouth
        screen:EraseRectangleFull(40, 110, 20, 10)   //draw new left eyebrow
        screen:EraseRectangleFull(116, 110, 20, 10)  //draw new right eyebrow
        screen:EraseRectangleFull(40, 40, 96, 10)    //draw new mouth
        button:WaitForButtonPress()                 //toggle the face

        screen:DrawRectangleFull(40, 110, 20, 10)  //erase previous left eyebrow
        screen:DrawRectangleFull(116, 110, 20, 10) //erase previous right eyebrow
        screen:DrawRectangleFull(40, 40, 96, 10)   //erase previous mouth
        screen:EraseRectangleFull(40, 120, 20, 10)   //draw new left eyebrow
        screen:EraseRectangleFull(116, 120, 20, 10)  //draw new right eyebrow
        screen:EraseRectangleFull(40, 30, 96, 30)    //draw new mouth
        button:WaitForButtonPress()                 //toggle the face
    end

Parameters

EraseRectangleOutline(integer xBottomLeft, integer yBottomLeft, integer width, integer height)

This action erases pixels in the shape of a rectangle outline from the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Utility utility
    Button button
    
    screen:DrawRectangleFull(0, 0, 177, 127)     //makes the screen black
    utility:DelayMilliseconds(500)
    screen:EraseRectangleOutline(30, 30, 118, 68) //rectangle's bottom left corner is 30, 30 with a width of 118 and height of 68
    utility:DelayMilliseconds(500)
    screen:EraseRectangleOutline(40, 40, 98, 48)
    utility:DelayMilliseconds(500)
    screen:EraseRectangleOutline(50, 50, 78, 28)
    button:WaitForButtonPress()

Parameters

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

Output(text message, integer line, integer indent)

This action displays a text message on a specific line of the screen with an indentation.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    integer indent = 0
    integer line = 0
    repeat until line = 8
        screen:Output("Indent = " + indent, line, indent) //displays the current indent on screen
        line = line + 1
        indent = indent + 1
    end
    button:WaitForButtonPress()

Parameters

Output(text message, integer line)

This action displays a text message on a specific line of the screen.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    Utility utility
    
    screen:Output("Hello!", 0)
    utility:DelayMilliseconds(500)
    screen:Output("I", 2)
    utility:DelayMilliseconds(500)
    screen:Output("Am", 3)
    utility:DelayMilliseconds(500)
    screen:Output("Your", 4)
    utility:DelayMilliseconds(500)
    screen:Output("Robot!", 5)
    utility:DelayMilliseconds(2000)

Parameters

OutputCenter(text message, integer line)

This action displays a centered text message on a specified text line of the screen

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.InfraredSensor
    use Libraries.Robots.Lego.Motor
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    InfraredSensor infraredSensor
    Motor motor
    Utility utility
    
    infraredSensor:SetPort(4)
    motor:RotateForward(motor:MOTOR_B)
    motor:RotateForward(motor:MOTOR_C)    //two motors to move the robot, connected to ports B and C
    repeat 20 times
       screen:OutputCenter("Distance: " + infraredSensor:GetDistance(), 0) //displays the distance on the top line
       utility:DelayMilliseconds(100)
    end

Parameters

OutputCenterLarge(text message, integer line)

This action displays a centered large text message, with each character's height spanning two text lines.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.InfraredSensor
    use Libraries.Robots.Lego.Motor
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    InfraredSensor infraredSensor
    Motor motor
    Utility utility
    
    infraredSensor:SetPort(4)
    motor:RotateForward(motor:MOTOR_B)
    motor:RotateForward(motor:MOTOR_C)    //two motors to move the robot, connected to ports B and C
    repeat 10 times
       screen:OutputCenterLarge("Dist.: " + infraredSensor:GetDistance(), 1) //displays the distance on the top line
       utility:DelayMilliseconds(100)
    end

Parameters

OutputInvertedColor(text message, integer line)

This action displays a message using inverted pixel colors. The rectangular space reserved for each character becomes solid black and the text displays as a cutout from that.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    Utility utility
    
    screen:OutputInvertedColor("Hello!", 0)
    utility:DelayMilliseconds(500)
    screen:OutputInvertedColor("I", 2)
    utility:DelayMilliseconds(500)
    screen:OutputInvertedColor("Am", 3)
    utility:DelayMilliseconds(500)
    screen:OutputInvertedColor("Your", 4)
    utility:DelayMilliseconds(500)
    screen:OutputInvertedColor("Robot!", 5)
    utility:DelayMilliseconds(2000)

Parameters

OutputInvertedColor(text message, integer line, integer indent)

This action displays a message using inverted pixel colors.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    integer indent = 0
    integer line = 0
    repeat until line = 8
        screen:OutputInvertedColor("Indent = " + indent, line, indent) //displays the current indent on screen
        line = line + 1
        indent = indent + 1
    end
    button:WaitForButtonPress()

Parameters

OutputLarge(text message, integer line)

This action displays a large text message, with each character's height spanning two text lines.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    Utility utility
    
    screen:OutputLarge("This", 0)
    screen:OutputLarge("is", 2)
    screen:OutputLarge("large", 4)
    screen:OutputLarge("text!", 6)
    utility:DelayMilliseconds(3000)

Parameters

OutputLarge(text message, integer line, integer indent)

This action displays a large text message, with each character's height spanning two text lines.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Button
    
    Screen screen
    Button button
    
    integer indent = 0
    integer line = 0
    repeat until line = 8
        screen:OutputLarge("indent:" + indent, line, indent) //displays the current indent on screen
        line = line + 2
        indent = indent + 1
    end
    button:WaitForButtonPress()

Parameters

ScrollUp(text message)

This action moves everything on the screen up by one text line and then places a message on the bottom line.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.ColorSensor
    
    Screen screen
    Utility utility
    ColorSensor colorSensor
    
    colorSensor:SetPort(colorSensor:PORT_3)
    text color = ""
    repeat 20 times
        color = colorSensor:GetColor()
        if color not= "none"
            screen:ScrollUp(color)      //scroll up and display color name on the bottom text line
        end
        utility:DelayMilliseconds(200)
    end

Parameters

ScrollUp(integer lines)

This action scrolls up an amount of text lines based on the passed parameter.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    
    Screen screen
    Utility utility
    
    screen:Output("Beep", 7)
    utility:DelayMilliseconds(500)
    screen:ScrollUp(1)              //scroll up one line
    screen:Output("Boop", 7)
    utility:DelayMilliseconds(500)
    screen:ScrollUp(2)              //scroll up two lines
    screen:Output("I am a robot!", 7)
    utility:DelayMilliseconds(3000)

Parameters

ScrollUp()

This action moves everything on the screen up by one text line.

Example Code

use Libraries.Robots.Lego.Screen
    use Libraries.Robots.Lego.Utility
    use Libraries.Robots.Lego.ColorSensor
    
    Screen screen
    Utility utility
    ColorSensor colorSensor
    
    colorSensor:SetPort(colorSensor:PORT_3)
    text color = ""
    repeat 20 times
        color = colorSensor:GetColor()
        if color not= "none"
            screen:ScrollUp()           //scroll up
            screen:Output(color, 7)     //display color name on the bottom text line
        end
        utility:DelayMilliseconds(200)
    end