Libraries.Robots.Spike.Display Documentation

The Display library is used to display images in the SPIKE App.

Example Code


use Libraries.Robots.Spike.Display
Display display
display:Text("Hi!")

Inherits from: Libraries.Language.Object

Variables Table

VariablesDescription
integer IMAGE_HUB_2
integer IMAGE_CAVE
integer IMAGE_ROBOT_3
integer IMAGE_OCEAN
integer IMAGE_ROBOT_4
integer IMAGE_PARK
integer IMAGE_BEACH
integer IMAGE_HUB_3
integer IMAGE_ROBOT_1
integer IMAGE_RANDOMHides the currently displayed image or text in the App.
integer IMAGE_ROBOT_5
integer IMAGE_PLAYGROUND
integer IMAGE_POLAR_BEAR
integer IMAGE_HAUNTED_HOUSE
integer IMAGE_CARNIVAL
integer IMAGE_HUB_4
integer IMAGE_BOOKSHELF
integer IMAGE_ROBOT_2
integer IMAGE_HUB_1
integer IMAGE_AMUSEMENT_PARK
integer IMAGE_MOON

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

Hide()

Hides the currently displayed image or text in the App.

Example

use Libraries.Robots.Spike.Display
use Libraries.Robots.Spike.Hub
Display display
Hub hb
display:Text("Hi!")
hb:Sleep(1000)
display:Hide()

Image(integer image)

Selects an image to show the App display utilizing one of the preset images defined as constants in the Display class.

Parameters

  • integer image: The image to show, an integer value from 1 to 21 obtained from one of the constants provided in this class.

Example

use Libraries.Robots.Spike.Display
Display display
display:Image(display:IMAGE_BEACH)

Show(boolean fullscreen)

Shows the currently selected image or text to the App display.

Parameters

  • boolean fullscreen: A boolean which will show the image in fullscreen if true, and as a pop-up if not.

Example

use Libraries.Robots.Spike.Display
Display display
display:Image(display:IMAGE_BEACH)
display:Show(tru)

Text(text value)

Selects the text to show to the App display.

Parameters

  • text value: The text to display to the screen.

Example

use Libraries.Robots.Spike.Display
Display display
display:Text("Hi!")