コード例 #1
0
ファイル: Window.cs プロジェクト: urbanyeti/sbad-engine
        private void _ResizeDivs()
        {
            // Resize widths
            int fixedWidth     = Divs.Where(x => !x.AutoWidth).Sum(x => x.Width);
            int remainderWidth = Width - fixedWidth;

            List <Div> autoDivs = Divs.Where(x => x.AutoWidth).ToList();

            if (autoDivs.Count > 0)
            {
                int newWidth = remainderWidth / autoDivs.Count;
                autoDivs.ForEach(x => x.Width = newWidth);
            }

            // Resize heights
            Divs.ForEach(x =>
            {
                if (x.AutoHeight)
                {
                    x.Height = Height;
                }
            });
        }
コード例 #2
0
ファイル: Window.cs プロジェクト: urbanyeti/sbad-engine
 public override void Draw(SpriteBatch spriteBatch, TextureFrameStore textureFrames)
 {
     this.DrawBorder(spriteBatch, textureFrames, BorderWidth, BorderColor);
     Divs.ForEach(x => x.Draw(spriteBatch, textureFrames));
 }