Skip to content

MT2D Aditional Functions

ibm5155 edited this page Sep 3, 2018 · 1 revision

Those are the functions that may not be used so often, but they exist:

Cursor

This file handles the cursor position, as a note, this only works in the terminal mode only, not graphics mode.

  • MT2D_Cursor_goto_topscreen: Moves the terminal cursor on top of the screen
  • MT2D_Cursor_Set_Position: Moves the terminal cursor to a given position

MT2D_File

This file handles a multiplatform way of handling FILES, basically, it tries to act the same way as the ansi C FILE struct, and you'll notice that most functions work the same way as the FILE one, but with better support for special operational systems like Android.

The file struct is called MT2D_File, and YOU SHOULD NEVER try to play with it's insides, you should actually use the given functions below to interact with the files (since the inside struct may vary and will result in errors)

  • MT2D_FILE_OPEN: Get a pointer to a file.
  • MT2D_FILE_CLOSE: Close the file.
  • MT2D_FILE_SEEK: Moves the file pointer to a given offset from the current seek or another position.
  • MT2D_FILE_READ: Read a given amount of bytes from the actual offset and return it.
  • MT2D_FILE_READ_BYTE: Read a byte from a given offset and return it.
  • MT2D_FILE_WRITE: Write a given amount of bytes from the actual offset.
  • MT2D_FILE_WRITE_BYTE: Write a byte on from the actual offset.
  • MT2D_FILE_EOF: return 0 if the file pointer reached the end of the file.
  • MT2D_FILE_TELL: Tells where's the file pointer located at the moment.

MT2D InputBoxes

those files are quite useful for getting information from the user, you can get integer input, string input and even a password like string input (where the user can't see what's being typed) NOTE: It's used the DISPLAY_WINDOW2 for displaying that information. NOTE2: The size of the popup is fixed so be careful by the size of the string that you want to show.

MT2D MessageBoxes

those files handle the messages that are shown to the users, they may be just a simple message popup or may get some Yes/No like input from the user. NOTE: It's used the DISPLAY_WINDOW2 for displaying that information. NOTE2: The size of the popup is fixed so be careful by the size of the string that you want to show.

MT2D_Generic_line

this file basically draws a horizontal or vertical line on the screen using characters that are informed by the programmer

MT2D_Menu

this file shows a menu like system where you can personalize it, you can change the coord where the menu is going to be shown, the number of options and even the selection item indicator NOTE: It's used the DISPLAY_WINDOW2 for displaying that information.

Clone this wiki locally