当前位置: 首页>>代码示例>>C++>>正文


C++ Text::Left方法代码示例

本文整理汇总了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);
	}
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:23,代码来源:ColorPicker.cpp

示例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);
	}
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:85,代码来源:MainPanel.cpp

示例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);
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:82,代码来源:ColorPicker.cpp


注:本文中的Text::Left方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。