module
Tput::Coordinates
Overview
Collection of methods related to coordinates within the terminal screen.
Included Modules
- Crystallabs::Helpers::Logging
Direct including types
Defined in:
tput/coordinates.crConstant Summary
-
Log =
::Log.for((self.name.gsub("::", '.')).underscore)
Instance Method Summary
-
#_adjust_xy_abs(x = 0, y = 0)
Returns [x,y] adjusted to within screen bounds.
-
#_adjust_xy_rel(x = 0, y = 0)
Returns [x,y] adjusted so that, added to the cursor's position, the result stays within screen bounds.
-
#_ncoords
Clamps
@cursorto screen bounds. -
#get_screen_size
Gets terminal/screen size as number of columns and rows.
-
#reset_screen_size
Gets terminal/screen size and resets the values in memory to the discovered dimensions.
Instance Method Detail
Returns [x,y] adjusted so that, added to the cursor's position, the result stays within screen bounds.
def _ncoords
#
Clamps @cursor to screen bounds.
Typical usage: set cursor position without worrying about bounds, then
call #_ncoords to bring it back into the screen if needed.
def reset_screen_size
#
Gets terminal/screen size and resets the values in memory to the discovered dimensions.