Exemplo n.º 1
0
uint32_t pixel_color(byte r, byte g, byte b)
{
  return PIXEL_COLOR(r,g,b);
}
Exemplo n.º 2
0
INLINE void WidgetContainer::Render()
{
	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();
	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		w->Render();
	}

	if (pConfiguration->bDebugContainer)
		pRendererDevice->DrawRect(this->GetX(), this->GetY(), this->GetWidth(), this->GetHeight(), PIXEL_COLOR(255, 0, 255, 255));
}
Exemplo n.º 3
0
INLINE PIXEL Texture::GetPixel(u32 x, u32 y) const
{
	QRgb px = image.pixel(x, y);
	return PIXEL_COLOR(qRed(px), qGreen(px), qBlue(px), qAlpha(px));
}
Exemplo n.º 4
0
void ISprite::Render()
{
	if (!this->bInitialized)
		return;

	ASSERT(pFrameImage);

	RendererPacket packet;
	packet.iSize = iNumVertices;
	packet.nMeshType = nMeshType;
	packet.pVertexData = arCurrentVertexData;
	packet.pTexture = pFrameImage;
	packet.nBlendMode = this->eBlendOperation;
	packet.iColor = this->iColor;
	pRendererDevice->UploadData(&packet);

	if (pConfiguration->bDebugSprite)
		pRendererDevice->DrawRect(this->GetX(), this->GetY(), this->GetWidth(), this->GetHeight(), PIXEL_COLOR(255, 255, 255, 255));
}
Exemplo n.º 5
0
void TextArea::Render()
{
	cText.SetBlending(eBlendOperation);
	cText.SetColor(iColor.pixel);
	cText.SetScale(fTextScaleX, fTextScaleY);

	for (u32 i = 0; i < iLines; i++)
	{
		if (!pLines[i].iIndex && !pLines[i].iSize)
			break;

		cText.SetPosition(pLines[i].fPosX + this->GetX(), pLines[i].fPosY + this->GetY());
		cText.Draw(pLines[i].iIndex, pLines[i].iSize);
	}

	if (pConfiguration->bDebugText)
		pRendererDevice->DrawRect(this->GetX(), this->GetY(), this->GetWidth(), this->GetHeight(), PIXEL_COLOR(255, 0, 0, 255));
}
Exemplo n.º 6
0
void Label::Render()
{
    cText.SetBlending(eBlendOperation);
    cText.SetColor(iColor.pixel);
    cText.SetScale(GetScaleX(), GetScaleY());
    cText.SetScale(fTextScaleX, fTextScaleY);
    cText.SetPosition(this->GetX(), this->GetY());
    cText.SetLocalPosition(this->GetLocalX(), this->GetLocalY());

    switch (iAlign)
    {
    case HorizontalAlignRight:
    {
        cText.SetPosition(this->GetX() + ((this->GetWidth() - cText.GetWidth())), this->GetY());
    }
    break;

    case HorizontalAlignCenter:
    {
        cText.SetPosition(this->GetX() + ((this->GetWidth() - cText.GetWidth()) / 2.0f), this->GetY());
    }
    break;

    case HorizontalAlignNone:
    case HorizontalAlignLeft:
    default:
        break;
    }

    cText.Draw();

    if (pConfiguration->bDebugText)
        pRendererDevice->DrawRect(this->GetX(), this->GetY(), this->GetWidth(), this->GetHeight(), PIXEL_COLOR(0, 255, 0, 255));
}