protected override void LoadContent()
{
var titleSafeArea = GraphicsDevice.Viewport.TitleSafeArea;
// 表示幅を TitleSafeArea から余白を考慮した値に設定。
width = titleSafeArea.Width - 16;
// 表示位置を計算。
// 高さはバーの数で変動するため、Bottom 合わせで固定し、Bottom ラインをベースに描画時に調整。
var layout = new DebugLayout()
{
ContainerBounds = titleSafeArea,
Width = width,
Height = 0,
HorizontalMargin = 8,
VerticalMargin = 8,
HorizontalAlignment = DebugHorizontalAlignment.Center,
VerticalAlignment = DebugVerticalAlignment.Bottom
};
layout.Arrange();
offsetX = layout.ArrangedBounds.X;
offsetY = layout.ArrangedBounds.Y;
spriteBatch = new SpriteBatch(GraphicsDevice);
fillTexture = Texture2DHelper.CreateFillTexture(GraphicsDevice);
spriteFont = Game.Content.Load <SpriteFont>(fontAssetName);
base.LoadContent();
}