예제 #1
0
        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;
        }
예제 #2
0
 public MultlineTextBox(ISpriteFont font, ITextSplitter splitter, int lineNumber)
 {
     this.lineNumber = lineNumber;
     this.font = font;
     this.splitter = splitter;
     container = new Container();
     container.Layout = new VBoxLayout();
 }
예제 #3
0
        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;
        }
예제 #4
0
        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();
        }
예제 #5
0
 protected override void UpdateComponents(Container container) 
 {
 }
예제 #6
0
        public void LayoutContainer_EmptyContainer_DoesNotThrow()
        {
            var testLayout = CreateLayout();
            var testContainer = new Container();

            Assert.DoesNotThrow(() => testLayout.LayoutContainer(testContainer));
        }
예제 #7
0
        private Container CreateContainer(GraphicComponentMock componentMock)
        {
            var container = new Container() { Layout = layoutMock.Object};
            container.AddComponent(componentMock);
            container.Draw();
            layoutMock.ResetCalls();

            return container;
        }