Skip to content

femto.mode.ScreenMode

Felipe Manga edited this page May 11, 2019 · 5 revisions

Summary

Abstract base class for all femto screen modes. Don't instance this directly.

Derivations

Methods

  • screen.fps()

Returns an int with the average framerate. It is inaccurate for the first 64 frames.

  • screen.setTextPosition( float x, float y )

Sets the coordinates for text drawing.

  • screen.setTextColor( int color )

Sets the color used for text drawing.

  • screen.width()

Returns the width of the screen in pixels (varies per screen mode).

  • screen.height()

Returns the height of the screen in pixels (varies per screen mode).

  • screen.print( [String|uint|int|float] text )

Draws text using the current font at the coordinates specified by setTextPosition.

  • screen.setPixel( int x, int y, int color )

Plots a pixel in the framebuffer. Does not take camera offset into consideration.

  • void drawHLine( int x, int y, int w, int color )
  • void drawVLine( int x, int y, int h, int color )
  • void drawRect( int x, int y, int w, int h, int color )
  • void fillRect( int x, int y, int w, int h, int color )
  • void drawCircle( int x0, int y0, int r, int color )
  • void fillCircle( int x0, int y0, int r, int color )
  • void drawLine(int x0, int y0, int x1, int y1, int color)