public UISystem(IServiceRegistry registry) : base(registry) { Services.AddService(typeof(UISystem), this); gameVirtualResolution = (IVirtualResolution)Services.GetService(typeof(IVirtualResolution)); gameVirtualResolution.VirtualResolutionChanged += OnGameVirtualResolutionChanged; }
protected ScriptContext(IServiceRegistry registry) { Services = registry; graphicsDeviceService = Services.GetSafeServiceAs <IGraphicsDeviceService>(); Game = Services.GetSafeServiceAs <IGame>(); virtualResolutionProvider = Services.GetSafeServiceAs <IVirtualResolution>(); Asset = (AssetManager)Services.GetSafeServiceAs <IAssetManager>(); Input = Services.GetSafeServiceAs <InputManager>(); Entities = Services.GetSafeServiceAs <EntitySystem>(); Script = Services.GetSafeServiceAs <ScriptSystem>(); RenderSystem = Services.GetSafeServiceAs <RenderSystem>(); EffectSystem = Services.GetSafeServiceAs <EffectSystem>(); Audio = Services.GetSafeServiceAs <AudioSystem>(); UI = Services.GetSafeServiceAs <UISystem>(); }
public SpriteRenderer(IServiceRegistry services) : base(services) { renderSystem = (RenderSystem)services.GetService(typeof(RenderSystem)); gameVirtualResolution = (IVirtualResolution)services.GetService(typeof(IVirtualResolution)); }