All Functions Modules Pages
screen

Functions

NIL screen.print (NUMBER x, NUMBER y, STRING txt)
 Prints text on the screen ( default values ). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt)
 Prints text on the screen ( custom font ). More...
 
NIL screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size)
 Prints text on the screen ( custom size ). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size)
 Prints text on the screen ( custom font and size ). More...
 
NIL screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face)
 Prints text on the screen (custom size and color, default font). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face)
 Prints text on the screen (custom font, size and color). More...
 
NIL screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow)
 Prints text on the screen (default font, size, colors). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow)
 Prints text on the screen (custom font, size and color). More...
 
NIL screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER align)
 Prints text on the screen (default font, size, colors, and custom alignment). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER align)
 Prints text on the screen (font, size, colors, and custom alignment). More...
 
NIL screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER align, NUMBER w)
 Prints text on the screen, limiting the width that can occupy (default font, size, colors, and custom alignment). More...
 
NIL screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER align, NUMBER w)
 Prints text on the screen, limiting the width that can occupy (font, size, colors, and custom alignment). More...
 
NUMBER screen.print (NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER scroll, NUMBER w)
 Prints text on the screen, limiting the width that can occupy (default font, size, colors, and custom scroll). More...
 
NUMBER screen.print (FONT fnt, NUMBER x, NUMBER y, STRING txt, NUMBER size, COLOR face, COLOR shadow, NUMBER scroll, NUMBER w)
 Prints text on the screen, limiting the width that can occupy (font, size, colors, and custom scroll). More...
 
NIL screen.clip (NUMBER x, NUMBER y, NUMBER w, NUMBER h)
 Limiting the drawing area. More...
 
NIL screen.clip ()
 Removes the limitation of the drawing area. More...
 
NUMBER screen.textwidth (STRING txt)
 Gets the text width in pixels (using the default values). More...
 
NUMBER screen.textwidth (STRING txt, NUMBER size)
 Gets the text width in pixels (using the default font, and custom text size). More...
 
NUMBER screen.textwidth (FONT fnt, STRING txt)
 Gets the text width in pixels (using custom font, and 0.7 as text size). More...
 
NUMBER screen.textwidth (FONT fnt, STRING txt, NUMBER size)
 Gets the text width in pixels (using custom font and text size). More...
 
NUMBER screen.textheight ()
 Gets the text height in pixels (using the default values). More...
 
NUMBER screen.textheight (NUMBER size)
 Gets the text height in pixels (using the default font, and custom text size). More...
 
NUMBER screen.textheight (FONT fnt)
 Gets the text height in pixels (using custom font). More...
 
NUMBER screen.textheight (FONT fnt, NUMBER size)
 Gets the text height in pixels (using custom font and text size). More...
 
NIL screen.clear (COLOR bkg)
 Clears the screen with the specified color. More...
 
IMAGE screen.toimage ()
 Makes an image with the screen content. More...
 
IMAGE screen.buffertoimage ()
 Makes an image with the draw buffer content. More...
 
NIL screen.shot ()
 Takes a screenshot and save it in the same homebrew folder with the name "screenshot.png" (if exists, it will be overwrite). More...
 
NIL screen.shot (STRING path)
 Takes a screenshot and save it in the specified folder with Toma una captura de pantalla, y la guarda en la ruta y con el nombre especificados. More...
 
NIL screen.consoleprint (STRING txt)
 Basic routine for printing text, use a monospaced font and start printing from the top left corner (the primary use of this function is debug). More...
 
NIL screen.txtcolor (COLOR txtColor)
 Change the color of the text printed with screen.consoleprint(). More...
 
NIL screen.txtbgcolor (COLOR bgColor)
 Change the background color of the text printed with screen.consoleprint(). More...
 
NUMBER screen.consolexy ()
 Gets the cursor position used by screen.consoleprint() (column and row). More...
 
NIL screen.consolexy (NUMBER x, NUMBER y)
 Sets the cursor position used by screen.consoleprint() (column and row). More...
 
NUMBER screen.fps ()
 Computes the screen frames per second (fps). More...
 
NIL screen.bilinear (NUMBER state)
 Enables the bilinear filter (smoothing). More...
 
NUMBER screen.brightness ()
 Gets the screen brightness. More...
 
NIL screen.brightness (NUMBER bright)
 Sets the screen brightness. More...
 
NIL screen.display (NUMBER mode)
 Enable or Disable the screen. More...
 
NIL screen.flip ()
 Refresh the screen. Any modifications made to it (display pictures, drawn shapes or text) will not be visible until this function is called . More...
 

Detailed Description

Screen managing.

Function Documentation

NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt 
)

Prints text on the screen ( default values ).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
Note
The default values are: size 0.7, color white, without shadow and left alingment.
Returns
Nada.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt 
)

Prints text on the screen ( custom font ).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
Returns
Nothing.
NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size 
)

Prints text on the screen ( custom size ).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
Returns
Nothing.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size 
)

Prints text on the screen ( custom font and size ).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
Returns
Nothing.
NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face 
)

Prints text on the screen (custom size and color, default font).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color.
Returns
Nothing.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face 
)

Prints text on the screen (custom font, size and color).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
Returns
Nothing.
NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow 
)

Prints text on the screen (default font, size, colors).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
Returns
Nothing.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow 
)

Prints text on the screen (custom font, size and color).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
Returns
Nothing.
NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  align 
)

Prints text on the screen (default font, size, colors, and custom alignment).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
alignAlignment of text, one of the following constants:
  • __ALEFT Left.
  • __ACENTER Centred.
  • __ARIGHT Right.
  • __AFULL Full justify text.
Returns
Nothing.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  align 
)

Prints text on the screen (font, size, colors, and custom alignment).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
alignAlignment of text, one of the following constants:
  • __ALEFT Left.
  • __ACENTER Centred.
  • __ARIGHT Right.
  • __AFULL Full justify text.
Returns
Nothing.
NIL screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  align,
NUMBER  w 
)

Prints text on the screen, limiting the width that can occupy (default font, size, colors, and custom alignment).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
alignAlignment of text, one of the following constants:
  • __ALEFT Left.
  • __ACENTER Centred.
  • __ARIGHT Right.
  • __AFULL Full justify text.
wWidth in pixels. If the text pass, will be trimmed and will continue on the next line.
Returns
Nothing.
NIL screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  align,
NUMBER  w 
)

Prints text on the screen, limiting the width that can occupy (font, size, colors, and custom alignment).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
alignAlignment of text, one of the following constants:
  • __ALEFT Left.
  • __ACENTER Centred.
  • __ARIGHT Right.
  • __AFULL Full justify text.
wWidth in pixels. If the text pass, will be trimmed and will continue on the next line.
Returns
Nothing.
NUMBER screen.print ( NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  scroll,
NUMBER  w 
)

Prints text on the screen, limiting the width that can occupy (default font, size, colors, and custom scroll).

Parameters
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
scrollScroll of text, one of the following constants:
  • __SLEFT Left.
  • __SRIGHT Right.
  • __STHROUGH Left (Through).
  • __SSEESAW Left-Right.
wWidth in pixels. If the text pass, will be trimmed and will continue on the next line.
Returns
A number that should happen again as coordinate X.

Consult the following sample for more details.

NUMBER screen.print ( FONT  fnt,
NUMBER  x,
NUMBER  y,
STRING  txt,
NUMBER  size,
COLOR  face,
COLOR  shadow,
NUMBER  scroll,
NUMBER  w 
)

Prints text on the screen, limiting the width that can occupy (font, size, colors, and custom scroll).

Parameters
fntA font previously loaded.
xX coordinate where the text is printed.
yY coordinate where the text is printed.
txtText to print.
sizeSize of the text. There is no restriction, but are preferable sizes close to 1.
faceText color
shadowShadow color.
scrollScroll of text, one of the following constants:
  • __SLEFT Left.
  • __SRIGHT Right.
  • __STHROUGH Left (Through).
  • __SSEESAW Left-Right.
wWidth in pixels. If the text pass, will be trimmed and will continue on the next line.
Returns
A number that should happen again as coordinate X.

Consult the following sample for more details.

NIL screen.clip ( NUMBER  x,
NUMBER  y,
NUMBER  w,
NUMBER  h 
)

Limiting the drawing area.

Parameters
xCoordinate X of the top left corner.
yCoordinate Y of the top left corner.
wWidth.
hHeight.
Returns
Nothing.
NIL screen.clip ( )

Removes the limitation of the drawing area.

Returns
Nothing.
NUMBER screen.textwidth ( STRING  txt)

Gets the text width in pixels (using the default values).

Parameters
txtText to get its width.
Returns
The text width in pixels.
NUMBER screen.textwidth ( STRING  txt,
NUMBER  size 
)

Gets the text width in pixels (using the default font, and custom text size).

Parameters
txtText to get its width.
sizeText size.
Returns
The text width in pixels.
NUMBER screen.textwidth ( FONT  fnt,
STRING  txt 
)

Gets the text width in pixels (using custom font, and 0.7 as text size).

Parameters
fntA loaded font.
txtText to get its width.
Returns
The text width in pixels.
NUMBER screen.textwidth ( FONT  fnt,
STRING  txt,
NUMBER  size 
)

Gets the text width in pixels (using custom font and text size).

Parameters
fntA loaded font.
txtText to get its width.
sizeText size.
Returns
The text width in pixels.
NUMBER screen.textheight ( )

Gets the text height in pixels (using the default values).

Returns
The text height in pixels.
NUMBER screen.textheight ( NUMBER  size)

Gets the text height in pixels (using the default font, and custom text size).

Parameters
sizeText size.
Returns
The text height in pixels.
NUMBER screen.textheight ( FONT  fnt)

Gets the text height in pixels (using custom font).

Parameters
fntA loaded font.
Returns
The text height in pixels.
NUMBER screen.textheight ( FONT  fnt,
NUMBER  size 
)

Gets the text height in pixels (using custom font and text size).

Parameters
fntA loaded font.
sizeText size.
Returns
The text height in pixels.
NIL screen.clear ( COLOR  bkg)

Clears the screen with the specified color.

Parameters
bkgColor to use.
Note
This function should not be used unless the intention is to paint the entire screen of a different color other than black (it does it automatically with screen.flip() ).
Returns
Nothing.
IMAGE screen.toimage ( )

Makes an image with the screen content.

Returns
An image object, ready to use.
IMAGE screen.buffertoimage ( )

Makes an image with the draw buffer content.

Returns
An image object, ready to use.
NIL screen.shot ( )

Takes a screenshot and save it in the same homebrew folder with the name "screenshot.png" (if exists, it will be overwrite).

Returns
Nothing.
NIL screen.shot ( STRING  path)

Takes a screenshot and save it in the specified folder with Toma una captura de pantalla, y la guarda en la ruta y con el nombre especificados.

Parameters
pathPath and name where the screenshot will be saved (only PNG format).
Returns
Nothing.
NIL screen.consoleprint ( STRING  txt)

Basic routine for printing text, use a monospaced font and start printing from the top left corner (the primary use of this function is debug).

Parameters
txtText to print.
Returns
Nothing.
NIL screen.txtcolor ( COLOR  txtColor)

Change the color of the text printed with screen.consoleprint().

Parameters
txtColorNew text color.
Returns
Nothing.
NIL screen.txtbgcolor ( COLOR  bgColor)

Change the background color of the text printed with screen.consoleprint().

Parameters
bgColorEl nuevo color del fondo del texto. Ignorar este argumento, o establecer un color completamente transparente (alpha = 0) desactiva el fondo del texto impreso.
Returns
Nothing.
NUMBER screen.consolexy ( )

Gets the cursor position used by screen.consoleprint() (column and row).

Returns
2 numbers. First one means column, and the second the row.
NIL screen.consolexy ( NUMBER  x,
NUMBER  y 
)

Sets the cursor position used by screen.consoleprint() (column and row).

Parameters
xThe new cursor horizontal position (column).
yThe new cursor vertical position (row).
Returns
Nothing.
NUMBER screen.fps ( )

Computes the screen frames per second (fps).

Returns
The actual framerate.
NIL screen.bilinear ( NUMBER  state)

Enables the bilinear filter (smoothing).

Parameters
stateOne of these values:
  • 1: Enable.
  • 0: Disable.
Warning
This function could make the text blurry, so is not recommended leave it enabled unless needed.
Returns
Nothing.
NUMBER screen.brightness ( )

Gets the screen brightness.

Returns
The actual screen brightness.
NIL screen.brightness ( NUMBER  bright)

Sets the screen brightness.

Parameters
brightThe new value for the screen brightness.
Returns
Nothing.
NIL screen.display ( NUMBER  mode)

Enable or Disable the screen.

Parameters
modeAny of the following values:
  • 1: Enable.
  • 0: Disable.
Note
Common use is energy saving.
Returns
Nothing.
NIL screen.flip ( )

Refresh the screen. Any modifications made to it (display pictures, drawn shapes or text) will not be visible until this function is called .

Returns
Nothing.