示例#1
0
        public ActivityDisplay() : base(new Vector2f(10, 64 + 10), new Vector2f(490, 200 - (64 + 10)))
        {
            ActivityName = new AlignedTextComponent(Position, new Vector2f(Size.X, Size.Y / 3), new Vector2f(0, 0), 17, TextPosition.Start, TextPosition.Middle, "", Color.White);
            ActivityText = new AlignedTextComponent(Position + new Vector2f(0, Size.Y / 3), new Vector2f(Size.X, Size.Y / 3), new Vector2f(0, 0), 15, TextPosition.Start, TextPosition.Middle, "", Color.White);

            RenderView  = RenderView.HUD;
            RenderLayer = RenderLayer.HUDFront;

            RegisterTickable();
        }
示例#2
0
        public TextInput(Vector2f position, Vector2f size, string placeholderText, uint fontSize, TextPosition horizontalPosition = TextPosition.Middle, TextPosition verticalPosition = TextPosition.Middle) : base(position, size)
        {
            Focused = false;

            InputText            = new AlignedTextComponent(position, size, new Vector2f(0, 0), fontSize, horizontalPosition, verticalPosition, "", new Color(255, 255, 255, 255));
            InputPlaceholderText = new AlignedTextComponent(position, size, new Vector2f(0, 0), fontSize, horizontalPosition, verticalPosition, placeholderText, new Color(200, 200, 200, 255));
            BoundingBox          = new RectangleComponent(position, size, new Color(32, 32, 32, 255), new Color(128, 128, 128, 255), 2);

            MessageBus.Instance.Register(MessageType.CancelInputs, OnCancelInputs);
            MessageBus.Instance.Register(MessageType.TextInput, OnKeyPressed);
        }
示例#3
0
 protected TextButton(Vector2f position, Vector2f size, string text, uint fontSize, TextPosition horizontalPosition = TextPosition.Middle, TextPosition verticalPosition = TextPosition.Middle) : base(position, size)
 {
     ButtonText = new AlignedTextComponent(Position, Size, new Vector2f(0, 0), fontSize, horizontalPosition, verticalPosition, text, Color.White);
 }
示例#4
0
 public TextBox(Vector2f position, Vector2f size, string text, uint fontSize, Color?textColor = null, TextPosition horizontalPosition = TextPosition.Middle, TextPosition verticalPosition = TextPosition.Middle) : base(position, size)
 {
     Text = new AlignedTextComponent(Position, Size, new Vector2f(0, 0), fontSize, horizontalPosition, verticalPosition, text, textColor ?? Color.White);
 }