Exemplo n.º 1
0
        public TextField TextField(int x, int y,
                                   int sizeX, int sizeY,
                                   Color textColor,
                                   SpriteFont font,
                                   ARenderStyle style,
                                   string hint = null,
                                   IHorizontalAlignable horizontalAlignment = null,
                                   IVerticalAlignable verticalAlignment     = null,
                                   IAlignmentTransition alignmentTransition = null,
                                   IColorPattern pattern       = null,
                                   TextAppenderHelper appender = null)
        {
            TextField textField = null;

            return(textField =
                       controlFactory.CreateTextBox(appender ?? TextAppenderHelper.Default,
                                                    font,
                                                    GetTexture(sizeX, sizeY, pattern),
                                                    new Region(new Vector2(x, y),
                                                               new Vector2(sizeX, sizeY)),
                                                    textColor,
                                                    style,
                                                    hint ?? string.Empty,
                                                    horizontalAlignment ?? HorizontalAlignment.Left,
                                                    verticalAlignment ?? VerticalAlignment.Center,
                                                    alignmentTransition ?? AlignmentTransition.Instant));
        }
Exemplo n.º 2
0
 public TextField CreateTextBox(TextAppenderHelper appender,
                                SpriteFont font,
                                Texture2D texture,
                                Region region,
                                Color textcolor,
                                ARenderStyle style,
                                string hint,
                                IHorizontalAlignable horizontalAlignment,
                                IVerticalAlignable verticalAlignment,
                                IAlignmentTransition transition)
 {
     return(new TextField(appender,
                          font,
                          texture,
                          region,
                          textcolor,
                          style,
                          hint,
                          new AlignmentContext(horizontalAlignment, verticalAlignment, transition)));
 }