public static void Startup( Game game, GameInput gameInput, UI.Settings settings ) { _UI.Settings = settings; _UI.Game = game; _UI.Content = new ContentManager( game.Services, "Content" ); _UI.PrimaryPad = -1; _UI.GameInput = gameInput; _UI.Texture = new UI.TextureManager(); _UI.Effect = new UI.EffectManager(); _UI.Sprite = new UI.SpriteManager(); _UI.Font = new UI.FontManager(); _UI.Screen = new UI.ScreenManager(); _UI.Store_Color = new UI.Store< UI.SpriteColors >( Color.Magenta ); _UI.Store_Timeline = new UI.Store< UI.Timeline >(); _UI.Store_Texture = new UI.Store< UI.SpriteTexture >( new UI.SpriteTexture( "null", 0.0f, 0.0f, 1.0f, 1.0f ) ); _UI.Store_FontStyle = new UI.Store< UI.FontStyle >(); _UI.Store_FontEffect = new UI.Store< UI.FontEffect >(); _UI.Store_FontIcon = new UI.Store_FontIcon(); _UI.Store_Widget = new UI.Store< UI.WidgetBase >(); _UI.Store_RenderState = new UI.Store< UI.RenderState >( new UI.RenderState( (int)UI.E_Effect.MultiTexture1, UI.E_BlendState.AlphaBlend ) ); _UI.Store_BlendState = new UI.Store< BlendState >(); _UI.Store_DepthStencilState = new UI.Store< DepthStencilState >(); _UI.Store_RasterizerState = new UI.Store< RasterizerState >(); _UI.Camera2D = new UI.CameraSettings2D(); _UI.Camera3D = new UI.CameraSettings3D(); PresentationParameters pp = game.GraphicsDevice.PresentationParameters; _UI.SX = pp.BackBufferWidth; _UI.SY = pp.BackBufferHeight; _UI.YT = 0.0f; _UI.YM = _UI.YT + ( _UI.SY * 0.5f ); _UI.YB = _UI.YT + _UI.SY; _UI.XL = 0.0f; _UI.XM = _UI.XL + ( _UI.SX * 0.5f ); _UI.XR = _UI.XL + _UI.SX; float safeArea = settings.Screen_SafeAreaSize; float offsetHalf = ( 1.0f - safeArea ) * 0.5f; _UI.SSY = _UI.SY * safeArea; _UI.SSX = _UI.SX * safeArea; _UI.SYT = _UI.SY * offsetHalf; _UI.SYM = _UI.SYT + ( _UI.SSY * 0.5f ); _UI.SYB = _UI.SYT + _UI.SSY; _UI.SXL = _UI.SX * offsetHalf; _UI.SXM = _UI.SXL + ( _UI.SSX * 0.5f ); _UI.SXR = _UI.SXL + _UI.SSX; _UI.AutoRepeatDelay = 0.5f; _UI.AutoRepeatRepeat = 0.25f; }
public static void Startup(Game game, GameInput gameInput, UI.Settings settings) { _UI.Settings = settings; _UI.Game = game; _UI.Content = new ContentManager(game.Services, "Content"); _UI.PrimaryPad = -1; _UI.GameInput = gameInput; _UI.Texture = new UI.TextureManager(); _UI.Effect = new UI.EffectManager(); _UI.Sprite = new UI.SpriteManager(); _UI.Font = new UI.FontManager(); _UI.Screen = new UI.ScreenManager(); _UI.Store_Color = new UI.Store <UI.SpriteColors>(Color.Magenta); _UI.Store_Timeline = new UI.Store <UI.Timeline>(); _UI.Store_Texture = new UI.Store <UI.SpriteTexture>(new UI.SpriteTexture("null", 0.0f, 0.0f, 1.0f, 1.0f)); _UI.Store_FontStyle = new UI.Store <UI.FontStyle>(); _UI.Store_FontEffect = new UI.Store <UI.FontEffect>(); _UI.Store_FontIcon = new UI.Store_FontIcon(); _UI.Store_Widget = new UI.Store <UI.WidgetBase>(); _UI.Store_RenderState = new UI.Store <UI.RenderState>(new UI.RenderState((int)UI.E_Effect.MultiTexture1, UI.E_BlendState.AlphaBlend)); _UI.Store_BlendState = new UI.Store <BlendState>(); _UI.Store_DepthStencilState = new UI.Store <DepthStencilState>(); _UI.Store_RasterizerState = new UI.Store <RasterizerState>(); _UI.Camera2D = new UI.CameraSettings2D(); _UI.Camera3D = new UI.CameraSettings3D(); PresentationParameters pp = game.GraphicsDevice.PresentationParameters; _UI.SX = pp.BackBufferWidth; _UI.SY = pp.BackBufferHeight; _UI.YT = 0.0f; _UI.YM = _UI.YT + (_UI.SY * 0.5f); _UI.YB = _UI.YT + _UI.SY; _UI.XL = 0.0f; _UI.XM = _UI.XL + (_UI.SX * 0.5f); _UI.XR = _UI.XL + _UI.SX; float safeArea = settings.Screen_SafeAreaSize; float offsetHalf = (1.0f - safeArea) * 0.5f; _UI.SSY = _UI.SY * safeArea; _UI.SSX = _UI.SX * safeArea; _UI.SYT = _UI.SY * offsetHalf; _UI.SYM = _UI.SYT + (_UI.SSY * 0.5f); _UI.SYB = _UI.SYT + _UI.SSY; _UI.SXL = _UI.SX * offsetHalf; _UI.SXM = _UI.SXL + (_UI.SSX * 0.5f); _UI.SXR = _UI.SXL + _UI.SSX; _UI.AutoRepeatDelay = 0.5f; _UI.AutoRepeatRepeat = 0.25f; }