本文整理汇总了C++中TextArea::SetFonts方法的典型用法代码示例。如果您正苦于以下问题:C++ TextArea::SetFonts方法的具体用法?C++ TextArea::SetFonts怎么用?C++ TextArea::SetFonts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextArea
的用法示例。
在下文中一共展示了TextArea::SetFonts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindow
//.........这里部分代码省略.........
te->XPos = XPos;
te->YPos = YPos;
te->Width = Width;
te->Height = Height;
te->ControlType = ControlType;
te->SetFont( fnt );
te->SetCursor( cursor );
te->SetBackGround( img );
win->AddControl( te );
}
break;
case IE_GUI_TEXTAREA:
{
//Text Area
ieResRef FontResRef, InitResRef;
Color fore, init, back;
ieWord SBID;
str->ReadResRef( FontResRef );
str->ReadResRef( InitResRef );
Font* fnt = core->GetFont( FontResRef );
Font* ini = core->GetFont( InitResRef );
str->Read( &fore, 4 );
str->Read( &init, 4 );
str->Read( &back, 4 );
str->ReadWord( &SBID );
TextArea* ta = new TextArea( fore, init, back );
ta->ControlID = ControlID;
ta->XPos = XPos;
ta->YPos = YPos;
ta->Width = Width;
ta->Height = Height;
ta->ControlType = ControlType;
ta->SetFonts( ini, fnt );
win->AddControl( ta );
if (SBID != 0xffff)
win->Link( SBID, ( unsigned short ) ControlID );
}
break;
case IE_GUI_LABEL:
{
//Label
ieResRef FontResRef;
ieStrRef StrRef;
RevColor fore, back;
ieWord alignment;
str->ReadDword( &StrRef );
str->ReadResRef( FontResRef );
Font* fnt = core->GetFont( FontResRef );
str->Read( &fore, 4 );
str->Read( &back, 4 );
str->ReadWord( &alignment );
Label* lab = new Label( fnt );
lab->ControlID = ControlID;
lab->XPos = XPos;
lab->YPos = YPos;
lab->Width = Width;
lab->Height = Height;
lab->ControlType = ControlType;
char* str = core->GetString( StrRef );
lab->SetText( str );
core->FreeString( str );
if (alignment & 1) {
lab->useRGB = true;
Color f, b;
示例2: GetWindow
//.........这里部分代码省略.........
ResourceHolder<ImageMgr> mos(BGMos);
Sprite2D *img = NULL;
if(mos) {
img = mos->GetSprite2D();
}
TextEdit* te = new TextEdit( ctrlFrame, maxInput, PosX, PosY );
te->ControlID = ControlID;
te->SetFont( fnt );
te->SetCursor( cursor );
te->SetBackGround( img );
//The original engine always seems to ignore this textfield
//te->SetText (Initial );
win->AddControl( te );
}
break;
case IE_GUI_TEXTAREA:
{
//Text Area
ieResRef FontResRef, InitResRef;
Color fore, init, back;
ieWord SBID;
str->ReadResRef( FontResRef );
str->ReadResRef( InitResRef );
Font* fnt = core->GetFont( FontResRef );
Font* ini = core->GetFont( InitResRef );
str->Read( &fore, 4 );
str->Read( &init, 4 );
str->Read( &back, 4 );
str->ReadWord( &SBID );
TextArea* ta = new TextArea( ctrlFrame, fore, init, back );
ta->ControlID = ControlID;
ta->SetFonts( ini, fnt );
win->AddControl( ta );
if (SBID != 0xffff)
win->Link( SBID, ( unsigned short ) ControlID );
}
break;
case IE_GUI_LABEL:
{
//Label
ieResRef FontResRef;
ieStrRef StrRef;
RevColor fore, back;
ieWord alignment;
str->ReadDword( &StrRef );
str->ReadResRef( FontResRef );
Font* fnt = core->GetFont( FontResRef );
str->Read( &fore, 4 );
str->Read( &back, 4 );
str->ReadWord( &alignment );
char* str = core->GetString( StrRef );
Label* lab = new Label( ctrlFrame, fnt, str );
core->FreeString( str );
lab->ControlID = ControlID;
if (alignment & 1) {
lab->useRGB = true;
Color f, b;
f.r = fore.b;
f.g = fore.g;
f.b = fore.r;
f.a = 0;
b.r = back.b;