Layout class that supports title safe area.
You have to support various resolutions when you develop multi-platform games. Also, you have to support title safe area for Xbox 360 games. This structure places given rectangle with specified alignment and margin based on layout area (client area) with safe area. Margin is percentage of client area size. Example: Place( region, 0.1f, 0.2f, Aligment.TopLeft ); Place region at 10% from left side of the client area, 20% from top of the client area. Place( region, 0.3f, 0.4f, Aligment.BottomRight ); Place region at 30% from right side of client, 40% from the bottom of the client area. You can individually specify client area and safe area. So, it is useful when you have split screen game which layout happens based on client and it takes care of the safe at same time.
Пример #1
0
        void onGraphicsDeviceReset()
        {
            var layout = new Layout(Core.graphicsDevice.Viewport);

            _position = layout.place(new Vector2(width, barHeight), 0, 0.01f, Alignment.BottomCenter);
        }
Пример #2
0
		void onGraphicsDeviceReset()
		{
			var layout = new Layout( Core.graphicsDevice.Viewport );
			_position = layout.place( new Vector2( width, barHeight ), 0, 0.01f, Alignment.BottomCenter );
		}