本文整理汇总了C++中Color4::ARGB方法的典型用法代码示例。如果您正苦于以下问题:C++ Color4::ARGB方法的具体用法?C++ Color4::ARGB怎么用?C++ Color4::ARGB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color4
的用法示例。
在下文中一共展示了Color4::ARGB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Redraw
void CurvePreview::Redraw()
{
if (!mCurve)
return;
TextureRef texture = mSprite->GetTexture();
if (!texture || texture->GetSize() != layout->GetSize())
{
texture = TextureRef(layout->GetSize(), PixelFormat::R8G8B8A8, Texture::Usage::RenderTarget);
mSprite->SetTexture(texture);
mSprite->SetTextureSrcRect(RectI(Vec2I(), texture->GetSize()));
}
const Color4 backColor(120, 120, 120, 255);
const Color4 curveColor(0, 255, 0, 255);
Camera prevCamera = o2Render.GetCamera();
Camera currCamera; currCamera.SetRect(mCurve->GetRect());
currCamera.SetScale(currCamera.GetScale().InvertedY());
o2Render.SetRenderTexture(texture);
o2Render.SetCamera(currCamera);
o2Render.Clear(backColor);
static Vector<Vertex2> buffer;
buffer.Clear();
auto curveColorHex = curveColor.ARGB();
auto& keys = mCurve->GetKeys();
for (auto& key : keys)
{
buffer.Add(Vertex2(key.position, key.value, curveColorHex, 0, 0));
auto points = key.GetApproximatedPoints();
for (int i = 0; i < key.GetApproximatedPointsCount(); i++)
buffer.Add(Vertex2(points[i], curveColorHex, 0, 0));
o2Render.DrawAAPolyLine(buffer.Data(), buffer.Count(), 2);
}
o2Render.UnbindRenderTexture();
o2Render.SetCamera(prevCamera);
}