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)); }
public static AControl TextHorizontalAlignment(this AControl control, IHorizontalAlignable horizontalAignment) { Contract.Requires(control.Text != null, "Use Text() before setting the text's color"); control.Text.Alignment.HorizontalAlignment = horizontalAignment; return(control); }
public AlignmentContext(IHorizontalAlignable horizontal, IVerticalAlignable vertical, IAlignmentTransition transition) { this.horizontal = horizontal; this.vertical = vertical; this.Transition = transition; }
public Label CreateLabel(string text, SpriteFont font, Color textcolor, Texture2D texture, Region region, IHorizontalAlignable horizontalAlignment, IVerticalAlignable verticalAlignment, IAlignmentTransition transition) { return(new Label(text, font, texture, region, textcolor, new AlignmentContext(horizontalAlignment, verticalAlignment, transition))); }
public ListView ListView(int x, int y, int sizeX, int sizeY, Orientation orientation, IHorizontalAlignable horizontalAlignment, IVerticalAlignable verticalAlignment, IAlignmentTransition alignmentTransition, IColorPattern pattern = null, params AControl[] controls) { return(controlFactory.CreateListView(GetTexture(sizeX, sizeY, pattern ?? Pattern.SolidColor(Color.White)), new Region(new Vector2(x, y), new Vector2(sizeX, sizeY)), orientation, new AlignmentContext(horizontalAlignment, verticalAlignment, alignmentTransition), controls.ToList().AsReadOnly())); }
public CheckBox CreateCheckBox(Texture2D backgroundTexture, Texture2D checkedTexture, Texture2D unCheckedTexture, ARenderStyle style, Region region, IHorizontalAlignable checkBoxHorizontalAlignment, IVerticalAlignable checkBoxVerticalAlignment, string text, SpriteFont font) { return(new CheckBox(backgroundTexture, region, style, new AlignmentContext(checkBoxHorizontalAlignment, checkBoxVerticalAlignment, AlignmentTransition.Instant), checkedTexture, unCheckedTexture, text, font)); }
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))); }
public Label Label(int x, int y, int sizeX, int sizeY, string text, SpriteFont font, Color textColor, IColorPattern pattern, IHorizontalAlignable horizontalAlignment = null, IVerticalAlignable verticalAlignment = null, IAlignmentTransition alignmentTransition = null) { return(controlFactory.CreateLabel(text, font, textColor, GetTexture(sizeX, sizeY, pattern), new Region(new Vector2(x, y), new Vector2(sizeX, sizeY)), horizontalAlignment ?? HorizontalAlignment.Left, verticalAlignment ?? VerticalAlignment.Center, alignmentTransition ?? AlignmentTransition.Instant)); }
public static AControl ScreenAlignment(this AControl listView, IHorizontalAlignable horizontalAignment, IVerticalAlignable verticalAignment) { listView.ScreenAlignment.HorizontalAlignment = horizontalAignment; listView.ScreenAlignment.VerticalAlignment = verticalAignment; return(listView); }