本文整理汇总了C++中Text::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ Text::Left方法的具体用法?C++ Text::Left怎么用?C++ Text::Left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::Left方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Actor
ColorSample::ColorSample(Actor *parent, int x, int y, int w, int h, bool _bEditControls)
: Actor(getRandomName(), parent, CANVAS, w, _bEditControls?56:h)
{
rEdit = gEdit = bEdit = NULL;
setColor(255, 255, 255);
SetPos(x, y);
if(_bEditControls)
{
Text *text;
text = AddText(" Red: ", Width() + 5, 0);
rEdit = AddEditBox(text->Right(), text->Top(), 48); rEdit->SetNumeric(0, 255, 1);
text = AddText("Green: ", text->Left(), rEdit->Down() + 2);
gEdit = AddEditBox(text->Right(), text->Top(), 48); gEdit->SetNumeric(0, 255, 1);
text = AddText(" Blue: ", text->Left(), gEdit->Down() + 2);
bEdit = AddEditBox(text->Right(), text->Top(), 48); bEdit->SetNumeric(0, 255, 1);
}
}
示例2: Panel
TutorialReminder::TutorialReminder()
: Panel("TutorialReminder", (GameControl::Get()->Width() - (WIDTH_REMINDER - 85))/2,
(GameControl::Get()->Height() - HEIGHT_REMINDER)/2,
WIDTH_REMINDER, HEIGHT_REMINDER)
{
SetModal();
bAlreadyShow = true;
chdir((GameControl::getEditorPath() + DIR_SEP + "Tutorials" + DIR_SEP + "Getting Started").c_str());
Text *text;
Button *button;
int y;
//Title
text = AddText("Welcome", CENTER_TEXT, 5);
y = DrawHLine(text->Down() + 2);
//Body
text = AddText("Thank you for choosing Game Editor\nFor a quick start, select a option below:", 30, y);
//Create a new game
y = DrawHLine(text->Down() + 10);
text = AddText("Create a new game:", 30, y);
button = AddButton("Create now", 58, text->Down() + 10, 0, 0, BT_NEWGAME);
//Demos
y = DrawHLine(button->Down() + 5);
text = AddText("Get game demos:", 30, y);
button = AddButton("Go to demo page", 58, text->Down() + 10, 0, 0, BT_DEMOS);
//Tutorials
y = DrawHLine(button->Down() + 5);
text = AddText("See the tutorials:", 30, y);
listTutorialDir = AddListDirectory(10, text->Down() + 10, 0, 0, LS_TUTORIAL, " Click here for the tutorials ");
listTutorialDir->setCanUseSystemFileDialog(false);
#if defined(WIN32) && !defined(GAME_EDITOR_HOME_EDITION)
button = AddButton("Get the newest tutorials", 58, listTutorialDir->Down() + 5, 0, 0, BT_UPDATE);
text = AddText("For more tutorials, select from Help Menu above", text->Left(), button->Down() + 5);
#else
text = AddText("For more tutorials, select from Help Menu above", text->Left(), listTutorialDir->Down() + 25);
#endif
listTutorialDir->SetPos((WIDTH_REMINDER - listTutorialDir->Width())/2, listTutorialDir->getImage()->Y());
listTutorialDir->AddFilter("gedt");
listTutorialDir->setShowDir(false);
listTutorialDir->setShowExtension(false);
//Help
y = DrawHLine(text->Down() + 5);
text = AddText("Get help:", 30, y);
button = AddButton("Read the documentation", 58, text->Down() + 10, 0, 0, BT_DOCS);
button = AddButton("Go to Game Editor's forum", 58, button->Down() + 5, 0, 0, BT_FORUM);
//Close
y = DrawHLine(button->Down() + 5);
button = AddButton("Close", (WIDTH_REMINDER-135)/2 - 30, y, 0, 0, BT_CLOSE);
button = AddButton(" Don't show again ", button->Right() + 10, y, 0, 0, BT_DONTSHOW);
//Logo
{
EditorDirectory dir;
logo = new Actor("ged_TutorialReminder_logo", this);
logo->AddAnimation("logo", "logo.png", 1, 1, 0, 0);
logo->SetPos(-logo->Width(), 0);
}
}
示例3: Panel
ColorPicker::ColorPicker(int _r, int _g, int _b)
: Panel("DlgColorPicker", (GameControl::Get()->Width() - WIDTH)/2,
(GameControl::Get()->Height() - HEIGHT)/2,
WIDTH, HEIGHT)
{
SetModal();
Text *text;
Button *button;
//Title
text = AddText("Color Picker", CENTER_TEXT, 5);
int y = DrawHLine(text->Down() + 2);
//Body
canvas = new ColorCanvas(this);
oldColor = new ColorSampleOfPicker(this);
newColor = new ColorSampleOfPicker(this);
canvas->SetPos(10, y + 2);
colorSlide = AddSlide(canvas->Right() + 5, canvas->Top(), 20, 256, SL_COLOR);
colorSlide->SetPos(1.0);
newColor->SetPos(colorSlide->Right() + 5, colorSlide->Top());
oldColor->SetPos(newColor->Left(), newColor->Down());
text = AddText(" Red: ", oldColor->Left(), oldColor->Down() + 16);
rEdit = AddEditBox(text->Right(), text->Top(), 32); rEdit->SetNumeric(0, 255, 1);
text = AddText(" Green: ", text->Left(), rEdit->Down() + 2);
gEdit = AddEditBox(text->Right(), text->Top(), 32); gEdit->SetNumeric(0, 255, 1);
text = AddText(" Blue: ", text->Left(), gEdit->Down() + 2);
bEdit = AddEditBox(text->Right(), text->Top(), 32); bEdit->SetNumeric(0, 255, 1);
text = AddText(" Hue: ", text->Left(), bEdit->Down() + 16);
hEdit = AddEditBox(text->Right(), text->Top(), 32); hEdit->SetNumeric(0, 359, 1);
text = AddText("Saturation: ", text->Left(), hEdit->Down() + 2);
sEdit = AddEditBox(text->Right(), text->Top(), 32); sEdit->SetNumeric(0, 100, 1);
text = AddText("Brightness: ", text->Left(), sEdit->Down() + 2);
vEdit = AddEditBox(text->Right(), text->Top(), 32); vEdit->SetNumeric(0, 100, 1);
listFix = AddListPop(oldColor->Left(), vEdit->Down() + 16, 104, 0, LS_FIX_COLOR);
//Close
y = DrawHLine(canvas->Down() + 2);
button = AddButton("Ok", (WIDTH-135)/2, y, 0, 0, OK_BUTTON); SetConfirmButton(button);
button = AddButton("Cancel", button->Right()+8, y, 0, 0, CANCEL_BUTTON); SetCancelButton(button);
listFix->AddText("Red");
listFix->AddText("Green");
listFix->AddText("Blue");
listFix->AddText("Hue");
listFix->AddText("Saturation");
listFix->AddText("Brightness");
listFix->SetText("Red");
fixedColor = FIX_RED;
r = _r;
g = _g;
b = _b;
oldColor->SetColor(r, g, b);
colorSlide->SetPos(r / 255.0);
UpdateSample(r, g, b);
UpdateCanvas(r, fixedColor);
UpdateSlideColor(r, g, b, fixedColor);
}