ScummVM API documentation
MADS::TextDialog Class Reference
Inheritance diagram for MADS::TextDialog:
MADS::Dialog MADS::MessageDialog MADS::Nebular::CopyProtectionDialog MADS::Nebular::PictureDialog

Public Member Functions

 TextDialog (MADSEngine *vm, const Common::String &fontName, const Common::Point &pos, int maxChars)
 
 TextDialog (MADSEngine *vm, const Common::String &fontName, const Common::Point &pos, MSurface *portrait, int maxTextChars)
 
 ~TextDialog () override
 
void draw () override
 
void drawWithInput ()
 
void addLine (const Common::String &line, bool underline=false)
 
void wordWrap (const Common::String &line)
 
void incNumLines ()
 
void addInput ()
 
void addBarLine ()
 
void underlineLine ()
 
void downPixelLine ()
 
void setLineXp (int xp)
 
int estimatePieces (int maxLen)
 
virtual void show ()
 

Protected Member Functions

void calculateBounds () override
 
- Protected Member Functions inherited from MADS::Dialog
virtual void save ()
 
virtual void restore ()
 
void drawContent (const Common::Rect &r, int seed, byte color1, byte color2)
 
 Dialog (MADSEngine *vm)
 
virtual ~Dialog ()
 
Common::Rect getBounds () const
 

Protected Attributes

Font_font
 
int _innerWidth
 
int _lineWidth
 
int _currentX
 
int _numLines
 
int _lineSize
 
int _askXp
 
int _askLineNum
 
Common::String _lines [20]
 
int _lineXp [20]
 
SpriteAsset_edgeSeries
 
MSurface_portrait
 
int _piecesPerCenter
 
int _fontSpacing
 
- Protected Attributes inherited from MADS::Dialog
MADSEngine_vm
 
MSurface_savedSurface
 
Common::Point _position
 
int _width
 
int _height
 
byte _dialogPalette [8 *3]
 
int TEXTDIALOG_CONTENT1
 
int TEXTDIALOG_CONTENT2
 
int TEXTDIALOG_EDGE
 
int TEXTDIALOG_BACKGROUND
 
int TEXTDIALOG_FC
 
int TEXTDIALOG_FD
 
int TEXTDIALOG_FE
 
int TEXTDIALOG_BLACK
 

Constructor & Destructor Documentation

◆ TextDialog() [1/2]

MADS::TextDialog::TextDialog ( MADSEngine vm,
const Common::String fontName,
const Common::Point pos,
int  maxChars 
)

Constructor

Parameters
vmEngine reference
fontNameFont to use for display
posPosition for window top-left
maxCharsHorizontal width of window in characters

◆ TextDialog() [2/2]

MADS::TextDialog::TextDialog ( MADSEngine vm,
const Common::String fontName,
const Common::Point pos,
MSurface portrait,
int  maxTextChars 
)

Constructor

Parameters
vmEngine reference
fontNameFont to use for display
posPosition for window top-left
portraitSpeaker portrait to show in dialog
maxTextCharsHorizontal width of text portion of window in characters

◆ ~TextDialog()

MADS::TextDialog::~TextDialog ( )
override

Destructor

Member Function Documentation

◆ calculateBounds()

void MADS::TextDialog::calculateBounds ( )
overrideprotectedvirtual

Calculate the bounds for the dialog

Reimplemented from MADS::Dialog.

◆ draw()

void MADS::TextDialog::draw ( )
overridevirtual

Draw the dialog

Reimplemented from MADS::Dialog.

◆ drawWithInput()

void MADS::TextDialog::drawWithInput ( )

Draw the dialog along with any input box

◆ addLine()

void MADS::TextDialog::addLine ( const Common::String line,
bool  underline = false 
)

Add a new line to the dialog

◆ wordWrap()

void MADS::TextDialog::wordWrap ( const Common::String line)

Adds one or more lines, word wrapping the passed text

◆ incNumLines()

void MADS::TextDialog::incNumLines ( )

Increments the number of text lines the text dialog uses

◆ addInput()

void MADS::TextDialog::addInput ( )

Adds an input area following previously added text

◆ addBarLine()

void MADS::TextDialog::addBarLine ( )

Adds a bar line to separate sections of text

◆ underlineLine()

void MADS::TextDialog::underlineLine ( )

Flags the previously added line to be underlined

◆ setLineXp()

void MADS::TextDialog::setLineXp ( int  xp)

Set the x position for the given line

◆ estimatePieces()

int MADS::TextDialog::estimatePieces ( int  maxLen)

Estimates the maximum dialog length for text dialogs with icons

◆ show()

virtual void MADS::TextDialog::show ( )
virtual

Show the dialog, and wait until a key or mouse press.

Reimplemented in MADS::Nebular::CopyProtectionDialog.


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