//Function that prints names
bool backgroundIntro()
{
    ifstream data;
    POINT p;
    Plotter screen;
/*    HWND consoleWnd = GetConsoleWindow();*/

    Sleep(100);
    //PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,23);
    cout<<"Created By:";
    Sleep(2000);


    Sleep(100);
    //PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,25);
    cout<<"Abril Resendiz";
    Sleep(2000);


    // PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,27);
    cout<<"Daniel Holt";
    Sleep(2000);


  //  PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,29);
    cout<<"Maggie Schmeltekopf";
    Sleep(2000);



    //  PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,31);
    cout<<"Victoria Robinson";
    Sleep(2000);


    // PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,33);
    cout<<"Emily Peirce";
    Sleep(2000);
    screen.clear();

    return exit;

}
Ejemplo n.º 2
0
int draw_axes(Plotter& plot, WorldPt cross, Color col_ax, int ax_thickness,
		float x_tic, float y_tic, bool labels, int width, int prec,
		Color col_lab)
{
	int const EPS = 1.0e-6f;
	int const fontsize = 15;

	float tic_pos;
	float direction;
	float limit;
	float tic_length;

	WorldPt wl;
	WorldPt wu;
	WorldPt p;
	ScrPt pv;

	int labelPixs;

	Color col_prev;
	int thick_prev;

	String str;

	Font my_font;
	if (!my_font.LoadFromFile("FreeMono.ttf", fontsize))
	{
		return EXIT_FAILURE;
	}

	col_prev = plot.get_draw_col();
	plot.set_draw_col(col_ax);
	thick_prev = plot.get_draw_thick();
	plot.set_draw_thick(ax_thickness);

	plot.get_world_ext(wl, wu);

	p.x = wl.x;
	p.y = cross.y;
	plot.move(p);

	p.x = wu.x;
	plot.draw(p);

	p.x = cross.x;
	p.y = wl.y;
	plot.move(p);

	p.y = wu.y;
	plot.draw(p);

	direction = 1.0f;
	limit = wu.x * (1.0f + EPS);

	if (limit == 0.0f)
	{
		limit = EPS * abs(wl.x);
	}
	x_tic = abs(x_tic);
	tic_length = 0.01f * (wu.y - wl.y);

	while (true)
	{
		tic_pos = cross.x + x_tic;
		while (direction * tic_pos <= limit)
		{
			p.x = tic_pos;
			p.y = cross.y;

			if (labels)
			{
				plot.world2scr(p, pv);

				labelPixs = 6 * width * fontsize / 10;
				pv.x -= labelPixs / 2;

				ostringstream ss;
				ss << setw(width) << setprecision(prec) << fixed << right
						<< tic_pos;
				str.SetText(ss.str());
				str.SetFont(my_font);
				str.SetColor(col_lab);
				str.SetSize(fontsize);
				str.SetPosition(pv.x, pv.y);
				plot.Draw(str);
			}

			plot.move(p);
			p.y += tic_length;
			plot.draw(p);
			tic_pos += x_tic;
		}

		if (direction < 0.0f)
		{
			break;
		}

		direction = -1.0f;
		limit = direction * wl.x;
		if (limit == 0.0f)
		{
			limit = EPS * abs(wu.x);
		}
		x_tic = -x_tic;
	}

	tic_length = 0.02f * (wu.x - wl.x);

	direction = 1.0f;
	limit = wu.y * (1.0f + EPS);
	if (limit == 0.0)
	{
		limit = EPS;
	}
	y_tic = abs(y_tic);
	tic_length = 0.01f * (wu.x - wl.x);

	while (true)
	{
		tic_pos = cross.y + y_tic;
		while (direction * tic_pos <= limit)
		{
			p.x = cross.x;
			p.y = tic_pos;

			if (labels)
			{
				plot.world2scr(p, pv);
				pv.y -= fontsize * 6 / 10;
				pv.x -= width * fontsize * 2 / 3;

				ostringstream ss;
				ss << setw(width) << setprecision(prec) << fixed << right
						<< tic_pos;
				str.SetText(ss.str());
				str.SetFont(my_font);
				str.SetColor(col_lab);
				str.SetSize(fontsize);
				str.SetPosition(pv.x, pv.y);
				plot.Draw(str);
			}

			plot.move(p);
			p.x += tic_length;

			plot.draw(p);
			tic_pos += y_tic;
		}

		if (direction < 0.0)
		{
			break;
		}

		direction = -1.0f;
		limit = direction * wl.y;
		if (limit == 0.0f)
		{
			limit = EPS;
		}
		y_tic = -y_tic;
	}
	plot.set_draw_col(col_prev);
	plot.set_draw_thick(thick_prev);
	return 0;
}