public static void DrawFullScreen(Texture2D texture) { float a = 1920f / 1080f; var q = new RectangleQuad(); q.SetupVertices(new vec2(-a, -1), new vec2(a, 1), vec2.Zero, vec2.Ones); q.SetColor(new color(1f, 1f, 1f, 1f)); DrawTextureSmooth.Using(new vec4(0, 0, 1, 1), ScreenAspect, texture); q.Draw(GameClass.Graphics); }
private void BlackOverlay(float s) { float a = 1920f / 1080f; var q = new RectangleQuad(); q.SetupVertices(new vec2(-a, -1), new vec2(a, 1), vec2.Zero, vec2.Ones); q.SetColor(new color(1f, 1f, 1f, 1f)); DrawSolid.Using(new vec4(0, 0, 1, 1), ScreenAspect, new color(0f, 0f, 0f, s)); q.Draw(GameClass.Graphics); Render.UnsetDevice(); }
public void Draw() { DrawTexture.Using(world.camvec, world.CameraAspect, texture); quad.SetColor(new color(1, 1, 1, alpha)); quad.Draw(GameClass.Game.GraphicsDevice); }
void DrawDragonLordMarker(int player, bool After = false) { if (!TrackDragonLord) { return; } vec2 cur = CurDragonLordPos[player]; vec2 prev = PrevDragonLordPos[player]; if (cur.x < 1 && cur.y < 1) { return; } var q = new RectangleQuad(); var p = cur * PercentSimStepComplete + prev * (1 - PercentSimStepComplete); p = GridToWorldCood(p); var s = vec(.01f, .01f) + .0001f * vec2.Ones * (float)Math.Cos(GameClass.Game.DrawCount * .08f); float alpha = 1; bool selected = DataGroup.UnitSummary[Int(UnitType.DragonLord) - 1]; if (!After) { alpha = selected ? .11f : .05f; color clr = selected ? new color(1f, 1f, 1f, alpha) : new color(.8f, .8f, .8f, alpha); q.SetupVertices(p - s * 3, p + s * 3, vec(0, 0), vec(1, 1)); q.SetColor(clr); DrawTexture.Using(camvec, CameraAspect, Assets.DragonLord_Marker); q.Draw(GameClass.Game.GraphicsDevice); q.SetupVertices(p - s * .5f, p + s * .5f, vec(0, 0), vec(1, 1)); q.SetColor(clr); DrawTexture.Using(camvec, CameraAspect, Assets.DragonLord_Marker); q.Draw(GameClass.Game.GraphicsDevice); } if (After) { float z = 14; if (CameraZoom <= z / 4f) { s *= 7; alpha = CoreMath.LerpRestrict(z / 4, 0, z / 8, 1, CameraZoom); } else { return; } q.SetupVertices(p - s, p + s, vec(0, 0), vec(1, 1)); q.SetColor(new color(.8f, .8f, .8f, 1f * alpha)); var texture = Assets.AoE_DragonLord[player]; if (player == MyPlayerNumber && selected) { texture = Assets.AoE_DragonLord_Selected; } DrawTexture.Using(camvec, CameraAspect, texture); q.Draw(GameClass.Game.GraphicsDevice); } }