void OnDestroy() { if (FontsManager.InstanceExists()) { FontsManager.Instance.onFontsUpdated -= UpdateFont; } }
/// <summary> /// Creates new instance of ComplexityAnalysisOptionPage /// </summary> public ComplexityAnalysisOptionPage(Lifetime lifetime, FontsManager fontsManager, OptionsSettingsSmartContext settings) : base(lifetime, fontsManager, PID) { myLifetime = lifetime; mySettings = settings; InitControls(); }
private void load(Bindable <TrackSong> activeTrack) { InternalChild = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { playButton = new CircularProgressPlayButton(TrackModel), title = new SpriteText { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Text = TrackModel.SongName, Font = FontsManager.GetFont(size: 20, weight: FontWeight.Medium), Colour = Color4.DarkGray, Margin = new MarginPadding { Left = 80 }, Padding = new MarginPadding { Bottom = 2 } }, heartIcon = new SpriteIcon { Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, Size = new Vector2(16), Icon = FontAwesome.Solid.Heart, Colour = Color4.LightGray } } }; activeTrack.BindValueChanged(onActiveTrackChanged); }
/// <summary> /// Creates new instance of InjectionHappyDetectorOptionPage /// </summary> public InjectionHappyDetectorOptionPage(Lifetime lifetime, FontsManager fontsManager, OptionsSettingsSmartContext settings) : base(lifetime, fontsManager, PID) { _lifetime = lifetime; _settings = settings; InitControls(); }
public override void UnloadContent() { base.UnloadContent(); FirstPlayer.Instance.UnloadContent(); SecondPlayer.Instance.UnloadContent(); this.background.UnloadContent(); FontsManager.UnloadContent(); Item.UnloadContent(); }
public sealed override void Initialise() { base.Initialise(); FirstPlayer.Instance.Initialise(); SecondPlayer.Instance.Initialise(); this.background = new Image("Backgrounds/seaFaded"); FontsManager.Initialise(); Item.Initialise(3); this.background.Initialise(); }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this); } else { Destroy(this); } }
public sealed override void LoadContent() { base.LoadContent(); this.playAgain = new Button(this.Content.Load <Texture2D>("Buttons/exit")); this.playAgain.Position = new Vector2(ScreenManager.Instance.Dimensions.X / 2 - this.playAgain.Size.X / 2f, ScreenManager.Instance.Dimensions.Y / 2); this.playAgain.Size = new Vector2(200, 100); this.playAgain.ConstFlash = true; FirstPlayer.Instance.LoadContent(); SecondPlayer.Instance.LoadContent(); this.background.LoadContent(); FontsManager.LoadContent(); Item.LoadContent(); }
public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); this.background.Draw(spriteBatch, Vector2.Zero); FirstPlayer.Instance.Draw(spriteBatch); SecondPlayer.Instance.Draw(spriteBatch); FontsManager.Draw(spriteBatch); if (FirstPlayer.Instance.ItemColliding == false) { Item.Draw(spriteBatch); } if (this.gameEnded) { this.playAgain.Draw(spriteBatch); } }
public SongHeader() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Child = new FillFlowContainer { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Direction = FillDirection.Vertical, Spacing = new Vector2(0, -10), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new Drawable[] { artist = new SpriteText { Text = "ganen", Font = FontsManager.GetFont(size: 40, weight: FontWeight.Black), Colour = Color4.LightGray, RelativeSizeAxes = Axes.X, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Truncate = true, Spacing = new Vector2(2, 0) }, title = new SpriteText { Text = "my top 2020 songs, I guess", Font = FontsManager.GetFont(size: 80, weight: FontWeight.Black), Colour = Color4.Black, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.X, Truncate = true, }, } }; }
private void load() { InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White }, new SpriteText { Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Margin = new MarginPadding { Top = 20, Left = 100 }, Text = "ganen. 2020.", Font = FontsManager.GetFont(weight: FontWeight.SemiBold), Colour = Color4.Black }, new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Absolute, size: 500), new Dimension(GridSizeMode.Distributed) }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Container { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Y, Width = 300, Margin = new MarginPadding { Top = 300 }, Masking = true, CornerRadius = 20, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex(@"358879"), }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.6f)), } }, }, new AlbumArt { Origin = Anchor.Centre, Anchor = Anchor.Centre, Margin = new MarginPadding { Left = 100 }, Size = new Vector2(300), } } }, new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.Distributed) }, Content = new[] { new Drawable[] { // Add hacky way to add space on first grid new Container { RelativeSizeAxes = Axes.X, Height = 150 } }, new Drawable[] { new FillFlowContainer { RelativeSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Children = new Drawable[] { new SongHeader(), new TrackListScreen { Margin = new MarginPadding { Top = 40 } } } } } } } }, } } }; }
private static void InitializeDefaultCore(IGraphicsDeviceService graphicsDeviceService) { if (graphicsDeviceService == null) throw new ArgumentNullException("graphicsDeviceService"); //TODO: Remove this or make a way to remove it if it is not used (ContentManager) //////////////////////////////////////////////////////////////// var services = new GameServiceContainer(); services.AddService(typeof (IGraphicsDeviceService), graphicsDeviceService); //TODO: Enable the user to change the RootDirectory _contentManager = new ContentManager(services, "Content"); /////////////////////////////////////////////////// SpriteRenderer = new SpriteBatchRenderer(Window.GraphicsDevice); Entities = new EntitiesManager(); Settings = new SettingsManager(); Input = new InputManager(); Cameras = new CameraManager(); Music = new MusicManager(_contentManager); SoundFX = new SoundFXManager(_contentManager); Textures = new TextureManager(_contentManager); Fonts = new FontsManager(_contentManager); InitializeManagers(); }