Пример #1
0
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
0
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
0
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);
}