示例#1
0
//----------------------------------------------------------------------------
UIFrame *LP_Manager::CreateHeadFrame()
{
	UIFrame *headFrame = new0 UIFrame();
	headFrame->SetPivot(0.0f, 0.5f);
	headFrame->SetAnchorHor(0.0f, 0.0f);
	headFrame->SetAnchorVer(0.0f, 1.0f);
	headFrame->SetSize(200.0f, 0.0f);

	UIButton *headBut = new0 UIButton();
	headFrame->AttachChild(headBut);
	headBut->SetAnchorHor(0.0f, 0.0f);
	headBut->SetAnchorVer(0.5f, 0.5f);
	headBut->SetSize(60.0f, 60.0f);
	headBut->SetAnchorParamHor(40.0f, 0.f);
	headBut->GetPicBoxAtState(UIButtonBase::BS_NORMAL)->SetTexture(
		"DataLauncher/images/icons/h_brid_72.png");
	headBut->SetStateColor(UIButtonBase::BS_NORMAL, Float3::WHITE);
	headBut->SetStateColor(UIButtonBase::BS_HOVERED, Float3::WHITE);
	headBut->SetStateColor(UIButtonBase::BS_PRESSED, Float3::WHITE);
	headBut->SetStateBrightness(UIButtonBase::BS_NORMAL, 1.0f);
	headBut->SetStateBrightness(UIButtonBase::BS_HOVERED, 1.0f);
	headBut->SetStateBrightness(UIButtonBase::BS_PRESSED, 1.05f);

	UIFText *nameText = new0 UIFText();
	headBut->AttachChild(nameText);
	nameText->LocalTransform.SetTranslateY(-2.0f);
	nameText->SetAnchorHor(0.5f, 0.5f);
	nameText->SetAnchorVer(0.0f, 0.0f);
	nameText->SetAnchorParamVer(7.0f, 0.0f);
	nameText->GetText()->SetFont("DataLauncher/fonts/msyh.ttc", 24, 24);
	nameText->GetText()->SetFontScale(0.5f);
	nameText->GetText()->SetFontColor(Float3::WHITE);
	nameText->GetText()->SetDrawStyle(FD_BORDER);
	nameText->GetText()->SetBorderShadowAlpha(0.5f);
	nameText->GetText()->SetText(PX2_LMVAL("mrtime"));

	return headFrame;
}
示例#2
0
//----------------------------------------------------------------------------
UIFrame *LP_Manager::CreateEngineFrame()
{
	UIFrame *engineFrame = new0 UIFrame();
	engineFrame->LocalTransform.SetTranslateY(-1.0f);
	engineFrame->SetAnchorHor(0.0f, 1.0f);
	engineFrame->SetAnchorVer(0.0f, 1.0f);

	float leftWidth = 200.0f;

	float engineButWidth = leftWidth - 10.0f;
	float engineButHeight = 50.0f;

	UIFrame *leftFrame = new0 UIFrame();
	engineFrame->AttachChild(leftFrame);
	leftFrame->SetAnchorHor(0.0f, 0.0f);
	leftFrame->SetAnchorVer(0.0f, 1.0f);
	leftFrame->SetAnchorParamHor(leftWidth / 2.0f, 0.0f);
	leftFrame->SetSize(leftWidth, 0.0f);
	UIPicBox *picBox = leftFrame->CreateAddBackgroundPicBox();
	picBox->SetColor(Float3::MakeColor(64, 64, 64));

	float height = -80.0f;
	// engine
	UIButton *butEngine = new0 UIButton();
	leftFrame->AttachChild(butEngine);
	butEngine->SetAnchorHor(0.5f, 0.5f);
	butEngine->SetAnchorVer(1.0f, 1.0f);
	butEngine->SetAnchorParamVer(height, 0.0f);
	butEngine->LocalTransform.SetTranslateY(-1.0f);
	butEngine->SetSize(engineButWidth, engineButHeight);

	// news
	height -= 100.0f;
	UIButton *butNews = new0 UIButton();
	butNews->SetStateColor(UIButtonBase::BS_NORMAL, Float3::MakeColor(80, 80, 80));
	butNews->SetStateColor(UIButtonBase::BS_HOVERED, Float3::MakeColor(100, 100, 100));
	butNews->SetStateColor(UIButtonBase::BS_PRESSED, Float3::MakeColor(60, 60, 60));
	leftFrame->AttachChild(butNews);
	butNews->SetAnchorHor(0.5f, 0.5f);
	butNews->SetAnchorVer(1.0f, 1.0f);
	butNews->SetAnchorParamVer(height, 0.0f);
	butNews->LocalTransform.SetTranslateY(-1.0f);
	butNews->SetSize(leftWidth, engineButHeight);

	// learn
	height -= 55.0f;
	UIButton *butLearn = new0 UIButton();
	leftFrame->AttachChild(butLearn);
	butLearn->SetAnchorHor(0.5f, 0.5f);
	butLearn->SetAnchorVer(1.0f, 1.0f);
	butLearn->SetAnchorParamVer(height, 0.0f);
	butLearn->LocalTransform.SetTranslateY(-1.0f);
	butLearn->SetSize(leftWidth, engineButHeight);

	// res
	height -= 55.0f;
	UIButton *butRes = new0 UIButton();
	leftFrame->AttachChild(butRes);
	butRes->SetAnchorHor(0.5f, 0.5f);
	butRes->SetAnchorVer(1.0f, 1.0f);
	butRes->SetAnchorParamVer(height, 0.0f);
	butRes->LocalTransform.SetTranslateY(-1.0f);
	butRes->SetSize(leftWidth, engineButHeight);

	UIFrame *rightFrame = new0 UIFrame();
	engineFrame->AttachChild(rightFrame);
	rightFrame->SetAnchorHor(0.0f, 1.0f);
	rightFrame->SetAnchorVer(0.0f, 1.0f);
	rightFrame->SetAnchorParamHor(leftWidth, 0.0f);

	AweUIFrame *aweFrame = new0 AweUIFrame();
	rightFrame->AttachChild(aweFrame);
	aweFrame->SetAnchorHor(0.0f, 1.0f);
	aweFrame->SetAnchorVer(0.0f, 1.0f);
	aweFrame->OpenURL("http://www.google.com/");

	return engineFrame;
}