Beispiel #1
0
void TitleScreen::Draw()
{
	GHScreen::Draw();

	MFView_Push();

	MFRect rect;
	rect.x = (MFDisplay_GetAspectRatio() >= 1.5) ? -106.0f : 0.0f;
	rect.y = 0.0f;
	rect.width = (MFDisplay_GetAspectRatio() >= 1.5) ? 852.0f : 640.0f;
	rect.height = 480.0f;
	MFView_SetOrtho(&rect);

	MFPrimitive_DrawUntexturedQuad(20, 20, 640-40, 480-40, MakeVector(0,0,0,0.8f));

	CenterText(30, 34, MFVector::yellow, "Main Menu", pHeading);

	float height = TEXT_HEIGHT;
	float y = 90-height;
	float x = 55.0f;

//	MFFont_DrawText(pText, , y+=height, 20, MFVector::white, "H - Enter help screen");

//	CenterText(rect.height - 20 - 54, 44, MFVector::red, "Press ESC to continue", pFancy);

	MFView_Pop();
}
Beispiel #2
0
void Bloque::SetNro(int nro,bool isOk)
{
    _nro = nro;
    std::string str= C::NumberToString<int>(nro);
    text.setString(str);
    if(isOk)
        text.setColor(Color::Green);
    else
        text.setColor(Color::Red);
    CenterText();
}
Beispiel #3
0
void ArrowInteractor::Redraw (Coord, Coord, Coord, Coord) {
    const char* none = "None";
    Coord x[3], y[3];

    if (canvas != nil) {
	output->ClearRect(canvas, 0, 0, xmax, ymax);

	if (_brush->None()) {
	    const Font* f = output->GetFont();
	    int width = f->Width(none);
	    int height = f->Height();

	    output->MoveTo((xmax - width + 1)/2, (ymax - height + 1)/2);
	    output->Text(canvas, none);

	} else {
            const Color* origfg = output->GetFgColor();
            const Color* origbg = output->GetBgColor();
            Resource::ref(origfg);
            Resource::ref(origbg);

	    output->SetBrush(_brush);
            output->SetColors(_fg, _bg);
	    output->Line(canvas, HPAD, ymax/2, xmax-HPAD, ymax/2);

	    if (_head) {
		x[2] = x[0] = xmax-ARROWX;
		y[0] = ymax/2 - ARROWY;
		x[1] = xmax-HPAD;
		y[1] = ymax/2;
		y[2] = ymax/2 + ARROWY;
		output->MultiLine(canvas, x, y, 3);
	    }
	    if (_tail) {
		x[2] = x[0] = ARROWX;
		y[0] = ymax/2 - ARROWY;
		x[1] = HPAD;
		y[1] = ymax/2;
		y[2] = ymax/2 + ARROWY;
		output->MultiLine(canvas, x, y, 3);
	    }

            if (_brush->Width() == 0) {
                CenterText("0", output, xmax, ymax);
                output->Text(canvas, "0");
            }

            output->SetColors(origfg, origbg);
            Resource::unref(origfg);
            Resource::unref(origbg);
	}
    }
}
Beispiel #4
0
void CBigIcon::DisplayStatus(LPCSTR lpszStatus)
{
	CClientDC	dc(this);
	CFont*		pOldFont = dc.SelectObject(&m_font);

	// The splash screen background is black, so use white text
    dc.SetBkColor(RGB(0,0,0));
    dc.SetTextColor(RGB(255,255,255));

	CenterText(dc, lpszStatus, 219);

	// Clean up
	dc.SetBkColor(RGB(255,255,255));
    dc.SetTextColor(RGB(0,0,0));
	dc.SelectObject(pOldFont);
}
Beispiel #5
0
void CBigIcon::DisplayCopyright(void)
{
	CClientDC	dc(this);
	CFont*		pOldFont = dc.SelectObject(&m_copyrightFont);
	CRect		rect;
	LPCSTR lpszCopyright = szLoadString(IDS_COPYRIGHT);
	// The splash screen background is black, use light grey text
    dc.SetBkColor(RGB(0,0,0));
    dc.SetTextColor(RGB(192, 192, 192));

	CenterText(dc, lpszCopyright, 237);

	// Clean up
	dc.SetBkColor(RGB(255,255,255));
    dc.SetTextColor(RGB(0,0,0));
	dc.SelectObject(pOldFont);
}
Beispiel #6
0
void ArrowInteractor::Redraw (Coord, Coord, Coord, Coord) {
    const char* none = "None";
    Coord x[3], y[3];

    if (canvas != nil) {
	output->ClearRect(canvas, 0, 0, xmax, ymax);

	if (_brush->None()) {
	    const Font* f = output->GetFont();
	    int width = f->Width(none);
	    int height = f->Height();

	    output->MoveTo((xmax - width + 1)/2, (ymax - height + 1)/2);
	    output->Text(canvas, none);

	} else {
            const Color* origfg = output->GetFgColor();
            const Color* origbg = output->GetBgColor();
            Resource::ref(origfg);
            Resource::ref(origbg);

	    output->SetBrush(_brush);
            output->SetColors(_fg, _bg);
#if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef Line
	    output->Line(canvas, HPAD, ymax/2, xmax-HPAD, ymax/2);
#define Line _lib_iv(Line)
#else
	    output->Line(canvas, HPAD, ymax/2, xmax-HPAD, ymax/2);
#endif /* Line */

	    /* remove the dashing for the arrowheads */
	    if (_head || _tail) 
	        if (_brush->dashed())
		    output->SetBrush(new PSBrush(0, _brush->Width()));

	    if (_head) {
		x[2] = x[0] = xmax-ARROWX;
		y[0] = ymax/2 - ARROWY;
		x[1] = xmax-HPAD;
		y[1] = ymax/2;
		y[2] = ymax/2 + ARROWY;
#if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef MultiLine
		output->MultiLine(canvas, x, y, 3);
#define MultiLine _lib_iv(MultiLine)
#else
		output->MultiLine(canvas, x, y, 3);
#endif /* MultiLine */
	    }
	    if (_tail) {
		x[2] = x[0] = ARROWX;
		y[0] = ymax/2 - ARROWY;
		x[1] = HPAD;
		y[1] = ymax/2;
		y[2] = ymax/2 + ARROWY;
#if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef MultiLine
		output->MultiLine(canvas, x, y, 3);
#define MultiLine _lib_iv(MultiLine)
#else
		output->MultiLine(canvas, x, y, 3);
#endif /* MultiLine */
	    }

            if (_brush->Width() == 0) {
                CenterText("0", output, xmax, ymax);
                output->Text(canvas, "0");
            }

            output->SetColors(origfg, origbg);
            Resource::unref(origfg);
            Resource::unref(origbg);
	}
    }
}
Beispiel #7
0
	void setSize(const sf::Vector2f& i) {m_Btn.setSize(i); CenterText();}
Beispiel #8
0
	void SetString(const sf::String& t) {m_Text.SetString(t); CenterText();}
Beispiel #9
0
void Bloque::Init()
{
    GameObject::Init();
    CenterText();
}
Beispiel #10
0
    void OnDraw(HDC hDC)
    {
        TextOut(hDC, 0, 0, szHint, lstrlen(szHint));
        CenterText(hDC, GetDeviceCaps(hDC, HORZRES)/2,
			GetDeviceCaps(hDC, VERTRES)/2, szFace, szMessage, 72);
    }