void RenderTargetTestScreen::Update(float32 timeElapsed) { ftime += timeElapsed; if (ftime > 5.0f) { UIHoleTransition *ft = new UIHoleTransition(); Polygon2 testPoly; testPoly.AddPoint(Vector2(50, 85)); testPoly.AddPoint(Vector2(size.x - 50, 50)); testPoly.AddPoint(Vector2(size.x - 25, size.y - 85)); testPoly.AddPoint(Vector2(80, size.y - 50)); Matrix3 t, invT, r; t.BuildTranslation(size/-2); invT.BuildTranslation(size/2); r.BuildRotation(DegToRad(10)); Matrix3 res = t * r * invT; testPoly.Transform(res); testPoly.Scale(size/2, 2.0f); ft->SetDuration(10.f); ft->SetPolygon(testPoly); UIScreenManager::Instance()->SetScreen(SCREEN_STATIC_TEXT, ft); SafeRelease(ft); ftime = 0; } }
void RenderHelper::DrawPolygonTransformed(const Polygon2 & polygon, bool closed, const Matrix3 & transform) { Polygon2 copyPoly = polygon; copyPoly.Transform(transform); RenderHelper::Instance()->DrawPolygon(copyPoly, closed); }