protected Container CreateContainer(float x = 0, float y = 0, float width = 0, float height = 0) { var container = new Container(); container.SetCoordinates(x, y, width, height); return container; }
public MultlineTextBox(ISpriteFont font, ITextSplitter splitter, int lineNumber) { this.lineNumber = lineNumber; this.font = font; this.splitter = splitter; container = new Container(); container.Layout = new VBoxLayout(); }
public PokemonMenuLine(TextureBox icon, HPLine hpLine, TextBox nameBox, HPText hpText, TextBox level, TextBox hpLabel, TextureProvider textureProvider) { mainContainer = new Container(); this.icon = icon; this.hpLine = hpLine; this.hpText = hpText; this.nameBox = nameBox; this.level = level; this.hpLabel = hpLabel; this.textureProvider = textureProvider; }
public override void Setup() { var iconDataContainer = new Container() {Layout = new HBoxLayout()}; var hpLineContainer = new Container() {Layout = new HBoxLayout()}; var nameLevelContainer = new Container() {Layout = new HBoxLayout()}; var dataContainer = new Container() {Layout = new VBoxLayout()}; hpLabel.Text = "HP:"; hpLabel.HorizontalPolicy = ResizePolicy.Preferred; hpLabel.PreferredTextHeight = 24; hpText.HorizontalPolicy = ResizePolicy.Preferred; hpLine.VerticalPolicy = ResizePolicy.Fixed; hpLine.Height = 24; hpLineContainer.AddComponent(hpLabel); hpLineContainer.AddComponent(hpLine); hpLineContainer.AddComponent(hpText); level.HorizontalPolicy = ResizePolicy.Preferred; nameLevelContainer.AddComponent(nameBox); nameLevelContainer.AddComponent(level); dataContainer.AddComponent(nameLevelContainer); dataContainer.AddComponent(hpLineContainer); icon.VerticalPolicy = icon.HorizontalPolicy = ResizePolicy.Fixed; iconDataContainer.AddComponent(icon); iconDataContainer.AddComponent(dataContainer); mainContainer = iconDataContainer; mainContainer.Setup(); }
protected override void UpdateComponents(Container container) { }
public void LayoutContainer_EmptyContainer_DoesNotThrow() { var testLayout = CreateLayout(); var testContainer = new Container(); Assert.DoesNotThrow(() => testLayout.LayoutContainer(testContainer)); }
private Container CreateContainer(GraphicComponentMock componentMock) { var container = new Container() { Layout = layoutMock.Object}; container.AddComponent(componentMock); container.Draw(); layoutMock.ResetCalls(); return container; }