SimpleHMI: Cursor control
There are several ways of specifying screen coordinates for positioning text, buttons and other items. The available possibilities are:
- Multiples of character width and height (which is all we have been doing so far)
- Relative to any of the 4 edges or either centre line
- As fractions of the screen height or width
The basic default screen has 40 columns of characters, numbered 0 to 39. The number of rows will depend on the screen dimensions of the target device. For example, Android devices come in a large number of screen resolutions such as 320×480, 1024×600 etc. It is possible to program a different number of characters across, but you have no direct control over the number of rows.
The screen can only be used in portrait orientation (relevant to Android).
The Cursor(Row, Col) hash function sets the cursor to an absolute location on the screen. If Row or Col is left blank, it is not changed (the comma must always be there).
Advance topic, handled elsewhere: It is also possible to position the cursor relative to the edges of the screen and relative to the centre of the screen, using character counts or fractions of the screen size.
The CursorRel(dRow, dCol) hash function moves the cursor relative to its current location on the screen.