public Text(float x, float y, string content, string fontName) : base(x, y, 1, 1) { Content = content; font = AssetManager.GetFont(fontName); Scale = new Vector2(1, 1); transform = Matrix.Identity; shader = new BMFontShader(Color.White, Color.Black, Color.Transparent); literalBounds = new MAABB(X, Y, Width, Height) { Color = PICO8.GrassGreen }; exactBounds = new MQuad(X, Y, Width, Height) { Color = PICO8.BloodRed }; broadBounds = new MAABB(X, Y, Width, Height) { Color = PICO8.FleshPink }; spriteCollection = new SpriteCollection(); CreateText(); }
public Fade(TransitionType type, float velocity, float acceleration, Color color) : base(type, velocity, acceleration) { defaultColor = color; fade = new MQuad(-PADDING, -PADDING, 1, 1) { Color = Color.Black }; }
/// <summary> /// Calculates a new quad by rotating this rect about its center by the /// specified angle clockwise /// </summary> /// <param name="degrees">Angle about which to rotate (degrees)</param> /// <returns>Returns the calculated quad</returns> public MQuad Rotate(double degrees) { var bottomLeft = new MPoint(MinX, MinY); var topLeft = new MPoint(MinX, MaxY); var topRight = new MPoint(MaxX, MaxY); var bottomRight = new MPoint(MaxX, MinY); var quad = new MQuad(bottomLeft, topLeft, topRight, bottomRight); var center = Centroid; return(quad.Rotate(degrees, center.X, center.Y)); }