ScummVM API documentation
Ultima::Ultima4::TextView Class Reference

#include <textview.h>

Inheritance diagram for Ultima::Ultima4::TextView:
Ultima::Ultima4::View

Public Member Functions

 TextView (int x, int y, int columns, int rows)
 
void reinit ()
 
int getCursorX () const
 
int getCursorY () const
 
bool getCursorEnabled () const
 
int getWidth () const
 
void drawChar (int chr, int x, int y)
 
void drawCharMasked (int chr, int x, int y, byte mask)
 
void textAt (int x, int y, const char *fmt,...)
 
void optionAt (int x, int y, char key, const char *fmt,...)
 
void scroll ()
 
void setCursorFollowsText (bool follows)
 
void setCursorPos (int x, int y, bool clearOld=true)
 
void enableCursor ()
 
void disableCursor ()
 
void drawCursor ()
 
void setFontColor (ColorFG fg, ColorBG bg)
 
void setFontColorFG (ColorFG fg)
 
void setFontColorBG (ColorBG bg)
 
void textSelectedAt (int x, int y, const char *text)
 
Common::String colorizeStatus (char statustype)
 
Common::String colorizeString (Common::String input, ColorFG color, uint colorstart, uint colorlength=0)
 
char getOptionAt (const Common::Point &mousePos)
 
void clearOptions ()
 
Common::Rect getTextBounds (int x, int y, int textWidth) const
 
- Public Member Functions inherited from Ultima::Ultima4::View
 View (int x, int y, int width, int height)
 
virtual void clear ()
 
virtual void update ()
 
virtual void update (int x, int y, int width, int height)
 
virtual void highlight (int x, int y, int width, int height)
 
virtual void unhighlight ()
 

Static Public Member Functions

static void cursorTimer (void *data)
 

Protected Attributes

int _columns
 
int _rows
 
bool _cursorEnabled
 
bool _cursorFollowsText
 
int _cursorX
 
int _cursorY
 
int _cursorPhase
 
Common::Array< Option > _options
 
- Protected Attributes inherited from Ultima::Ultima4::View
Common::Rect _bounds
 
Common::Rect _highlightBounds
 
bool _highlighted
 

Static Protected Attributes

static Image_charset
 
- Static Protected Attributes inherited from Ultima::Ultima4::View
static Image_screen
 

Additional Inherited Members

- Protected Member Functions inherited from Ultima::Ultima4::View
void drawHighlighted ()
 

Detailed Description

A view of a text area. Keeps track of the cursor position.

Member Function Documentation

◆ reinit()

void Ultima::Ultima4::TextView::reinit ( )
virtual

Hook for reinitializing when graphics reloaded.

Reimplemented from Ultima::Ultima4::View.

◆ drawChar()

void Ultima::Ultima4::TextView::drawChar ( int  chr,
int  x,
int  y 
)

Draw a character from the charset onto the view.

◆ drawCharMasked()

void Ultima::Ultima4::TextView::drawCharMasked ( int  chr,
int  x,
int  y,
byte  mask 
)

Draw a character from the charset onto the view, but mask it with horizontal lines. This is used for the avatar symbol in the statistics area, where a line is masked out for each virtue in which the player is not an avatar.

◆ textAt()

void Ultima::Ultima4::TextView::textAt ( int  x,
int  y,
const char *  fmt,
  ... 
)

Draw text at the given position

◆ optionAt()

void Ultima::Ultima4::TextView::optionAt ( int  x,
int  y,
char  key,
const char *  fmt,
  ... 
)

Draw an option at

◆ textSelectedAt()

void Ultima::Ultima4::TextView::textSelectedAt ( int  x,
int  y,
const char *  text 
)

Highlight the selected row using a background color

◆ colorizeStatus()

Common::String Ultima::Ultima4::TextView::colorizeStatus ( char  statustype)

Depending on the status type, apply colorization to the character

◆ colorizeString()

Common::String Ultima::Ultima4::TextView::colorizeString ( Common::String  input,
ColorFG  color,
uint  colorstart,
uint  colorlength = 0 
)

Depending on the status type, apply colorization to the character

◆ getOptionAt()

char Ultima::Ultima4::TextView::getOptionAt ( const Common::Point mousePos)

Checks if a given position has an option

◆ clearOptions()

void Ultima::Ultima4::TextView::clearOptions ( )

Clear the options list

◆ getTextBounds()

Common::Rect Ultima::Ultima4::TextView::getTextBounds ( int  x,
int  y,
int  textWidth 
) const

Returns the physical screen dimensions of text at a given text location

Member Data Documentation

◆ _rows

int Ultima::Ultima4::TextView::_rows
protected

size of the view in character cells

◆ _cursorEnabled

bool Ultima::Ultima4::TextView::_cursorEnabled
protected

whether the cursor is enabled

◆ _cursorFollowsText

bool Ultima::Ultima4::TextView::_cursorFollowsText
protected

whether the cursor is moved past the last character written

◆ _cursorY

int Ultima::Ultima4::TextView::_cursorY
protected

current position of cursor

◆ _cursorPhase

int Ultima::Ultima4::TextView::_cursorPhase
protected

the rotation state of the cursor

◆ _charset

Image* Ultima::Ultima4::TextView::_charset
staticprotected

image containing font


The documentation for this class was generated from the following file: