// Загрузка уровня public override void OnStart(Action callback) { PoolManager.SpawnObject(Resources.Load(starsSkyPath) as GameObject); loadingLevelPanel = UiManager.EnablePanel <LoadedLevelPanel>(); loadingLevelPanel.StatusText.text = StringKeys.Loading; gameplayState = DI.Resolve <GameplayState>(); gameplayState.LevelMusic = LevelsManager.Instance.Levels[loadingLevelIndex].music; gameplayState.Player = new Player(); gameplayState.Player.Init(selectedShip, gameplayState.Lose); gameplayState.EnemyManager = new EnemyManager(); gameplayState.EnemyManager.Init(LevelsManager.Instance.Levels[loadingLevelIndex].LevelData.levelObjects.ToArray()); gameplayState.BackgoundPrefab = LevelsManager.Instance.Levels[loadingLevelIndex].Background; backgroundPanel = UiManager.EnablePanel <BackgroundPanel>(); backgroundPanel.SetImage(Resources.Load <Sprite>(backgroundPanelPath)); loadingLevelPanel.StatusText.text = StringKeys.PressToStart; MonoBehaviourTools.Instance.StartCor(StartGame()); callback?.Invoke(); }
private void OnUnloaded(object sender, RoutedEventArgs e) { Dispose(); BackgroundPanel.RemoveFromVisualTree(); Viewfinder.RemoveFromVisualTree(); }
// Load graphics content for the screen. public override void LoadGraphicsContent(bool loadAllContent) { width = Game.Window.ClientBounds.Width; height = Game.Window.ClientBounds.Height; Texture2D backgroundTexture = LHGGraphicsHelper.getGradientTexture(lhg.GraphicsDevice, width, height, Color.DarkBlue, Color.Chocolate); background = new BackgroundPanel(lhg, backgroundTexture, true); }
public override void OnStart(Action callback) { mainMenuBackgroundPanel = UiManager.EnablePanel <BackgroundPanel>(); mainMenuBackgroundPanel.SetImage(Resources.Load <Sprite>(mainMenuBackgroundPath)); mainMenuSelectShipPanel = UiManager.EnablePanel <MainMenuPanel>(); mainMenuMusic = new MainMenuMusic(); AudioManager.Instance.PlayMusic(mainMenuMusic); callback?.Invoke(); }
private void _initializeComponents() { _bpMain = new BackgroundPanel(); this.Content = _bpMain; _bmMain = new BarManager() { AllowCustomization = false, AllowQuickCustomization = false }; _bpMain.Content = _bmMain; _bMainMenu = new Bar() { IsMainMenu = true, AllowCustomizationMenu = false, AllowQuickCustomization = DevExpress.Utils.DefaultBoolean.False, DockInfo = new BarDockInfo() { ContainerType = BarContainerType.Top } }; _bmMain.Bars.Add(_bMainMenu); _btn_Refresh = new BarButtonItem() { Content = "Refresh", Glyph = new BitmapImage(((DXImageInfo) new DXImageConverter().ConvertFromString("Refresh_16x16.png")).MakeUri()) }; _btn_Refresh.ItemClick += _btn_Refresh_ItemClick; _btn_Add = new BarButtonItem() { Content = "Add", Glyph = new BitmapImage(((DXImageInfo) new DXImageConverter().ConvertFromString("AddNewDataSource_16x16.png")).MakeUri()) }; _btn_Add.ItemClick += _btn_Add_ItemClick; _btn_Edit = new BarButtonItem() { Content = "Edit", Glyph = new BitmapImage(((DXImageInfo) new DXImageConverter().ConvertFromString("EditDataSource_16x16.png")).MakeUri()) }; _btn_Edit.ItemClick += _btn_Edit_ItemClick; _btn_Delete = new BarButtonItem() { Content = "Delete", Glyph = new BitmapImage(((DXImageInfo) new DXImageConverter().ConvertFromString("DeleteDataSource_16x16.png")).MakeUri()) }; _btn_Delete.ItemClick += _btn_Delete_ItemClick; _bei_Filter = new BarEditItem() { EditSettings = new TextEditSettings(), EditWidth = 150, Content = "Filter" }; _bei_Filter.EditValueChanged += _bei_Filter_EditValueChanged; _bMainMenu.Items.Add(_btn_Refresh); _bMainMenu.Items.Add(_btn_Add); _bMainMenu.Items.Add(_btn_Edit); _bMainMenu.Items.Add(_btn_Delete); _bMainMenu.Items.Add(_bei_Filter); _bmMain.Child = _generateView(); }
protected override void LoadContent() { base.LoadContent(); Texture2D texture = Content.Load <Texture2D>("Backgrounds/ratingscreen"); background = new BackgroundPanel(lhg, texture, true); addStartButton(); /* * S - STR - Strength * U - UTI - Utilization * R - RES - Resourcefulness * V - VIT - Vitality * I - INT - Intelligence * V - VIS - Vision * A - AGI - Agility * L - LCK - Luck * * */ float horizontalSpacing = 500.0f; strengthNumberBox = createNumberBox(new Vector2(horizontalSpacing, 60.0f), stats.strength, "STR"); numberBoxes.Add(strengthNumberBox); utilizationNumberBox = createNumberBox(new Vector2(horizontalSpacing, 145.0f), stats.utilization, "UTI"); numberBoxes.Add(utilizationNumberBox); resourcefulnessNumberBox = createNumberBox(new Vector2(horizontalSpacing, 230.0f), stats.resourcefulness, "RES"); numberBoxes.Add(resourcefulnessNumberBox); vitalityNumberBox = createNumberBox(new Vector2(horizontalSpacing, 315.0f), stats.vitality, "VIT"); numberBoxes.Add(vitalityNumberBox); intelligenceNumberBox = createNumberBox(new Vector2(horizontalSpacing, 400.0f), stats.intelligence, "INT"); numberBoxes.Add(intelligenceNumberBox); visionNumberBox = createNumberBox(new Vector2(horizontalSpacing, 485.0f), stats.vision, "VIS"); numberBoxes.Add(visionNumberBox); agilityNumberBox = createNumberBox(new Vector2(horizontalSpacing, 570.0f), stats.agility, "AGI"); numberBoxes.Add(agilityNumberBox); luckNumberBox = createNumberBox(new Vector2(horizontalSpacing, 655.0f), stats.luck, "LCK"); numberBoxes.Add(luckNumberBox); }
private void GetColors(string name) { if (name == "DeepBlue") { Background = DefaultThemeBackgroundColor; Foreground = DefaultThemeForegroundColor; BorderBrush = DefaultThemeBackgroundColor; return; } ThemeManager.ThemeChanged -= ThemeChanged; var p = new BackgroundPanel(); ThemeManager.SetThemeName(p, name); Background = p.Background; Foreground = p.Foreground; BorderBrush = p.BorderBrush; ThemeManager.ThemeChanged += ThemeChanged; }
private void HaEditor_Load(object sender, EventArgs e) { // This has to be here and not in .ctor for some reason, otherwise subwindows are not locating properly tilePanel = new TilePanel(hcsm) { Enabled = false }; objPanel = new ObjPanel(hcsm) { Enabled = false }; lifePanel = new LifePanel(hcsm) { Enabled = false }; portalPanel = new PortalPanel(hcsm) { Enabled = false }; bgPanel = new BackgroundPanel(hcsm) { Enabled = false }; commonPanel = new CommonPanel(hcsm) { Enabled = false }; List <DockContent> dockContents = new List <DockContent> { tilePanel, objPanel, lifePanel, portalPanel, bgPanel, commonPanel }; dockContents.ForEach(x => x.Show(dockPanel)); dockContents.ForEach(x => x.DockState = DockState.DockRight); dockContents.ForEach(x => x.DockAreas = DockAreas.DockRight); commonPanel.Pane = bgPanel.Pane = portalPanel.Pane = lifePanel.Pane = objPanel.Pane = tilePanel.Pane; if (!hcsm.backupMan.AttemptRestore()) { hcsm.LoadMap(new Load(multiBoard, tabs, hcsm.MakeRightClickHandler())); } }
internal async Task Expand() { // setup for animation this.Opacity = 1; ExercisePopoverGrid.Opacity = 0; AddToCartButton.ScaleX = 0; BackgroundPanel.TranslationY = BackgroundPanel.Height; // animate up the white background _ = BackgroundPanel.TranslateTo(0, 0, 200); // animate int the Details await ExercisePopoverGrid.FadeTo(1, 500); // aminate the button Animation animation = new Animation(); animation.Add(0, 1, new Animation(t => AddToCartButton.ScaleX = t, 0, 1, Easing.SpringOut)); animation.Commit(this, "ButtonAnimation", 16, 500); }
public ProgressBusyIndicator() { BackgroundPanel panel = new BackgroundPanel(); TextBlock tb = new TextBlock() { Text = "Loading...", Margin = new Thickness(30) }; panel.Content = tb; Content = panel; Topmost = true; ThemeManager.SetThemeName(this, ThemeProvider.Instance.ThemeName); BorderThickness = new Thickness(1); ResizeMode = ResizeMode.NoResize; WindowStartupLocation = WindowStartupLocation.CenterScreen; WindowStyle = WindowStyle.None; SizeToContent = SizeToContent.WidthAndHeight; Timer = new DispatcherTimer(); Timer.Tick += Timer_Tick; Timer.Interval = TimeSpan.FromMilliseconds(100); Timer.Start(); }
private void InitComponents() { this.Content = null; BackgroundPanel _pnl = new BackgroundPanel() { MinWidth = 400, MinHeight = 200 }; Content = _pnl; LayoutControl _lc = new LayoutControl(); _pnl.Content = _lc; LayoutGroup _lg = _lc.CreateGroup(); _lc.Children.Add(_lg); _lg.View = LayoutGroupView.GroupBox; _lg.Orientation = Orientation.Vertical; _lg.Header = typeof(T).Name; _lg.Margin = new System.Windows.Thickness(5); foreach (var prop in typeof(T).GetProperties().AsEnumerable().Where(a => Attribute.IsDefined(a, typeof(UIAPropertyAttribute)))) { foreach (UIAPropertyAttribute attr in prop.GetCustomAttributes(typeof(UIAPropertyAttribute), true)) { LayoutItem _i = new LayoutItem() { Label = attr.Label }; object e = null; switch (attr.EditorType) { case EUIAEditorType.ComboBox: Type tttt = attr.TypeOfValues; e = new ComboBoxEdit(); _i.Content = e as UIElement; ((ComboBoxEdit)e).ValueMember = "ID"; ((ComboBoxEdit)e).DisplayMember = "ListBoxDisplay"; ((ComboBoxEdit)e).AutoComplete = true; var _v = Activator.CreateInstance(attr.TypeOfValues); MethodInfo _mi = tttt.GetMethod("LoadAll"); if (_mi != null) { ((ComboBoxEdit)e).ItemsSource = _mi.Invoke(_v, null); } Bindings.Add(prop.Name, _initBinding(prop.Name, ((ComboBoxEdit)_i.Content) as FrameworkElement, ComboBoxEdit.EditValueProperty)); break; case EUIAEditorType.IntEdit: e = new SpinEdit(); ((SpinEdit)e).IsFloatValue = false; _i.Content = e as UIElement; Bindings.Add(prop.Name, _initBinding(prop.Name, ((SpinEdit)_i.Content) as FrameworkElement, SpinEdit.EditValueProperty)); break; case EUIAEditorType.DecEdit: e = new TextEdit(); ((TextEdit)e).MaskType = MaskType.Numeric; _i.Content = e as UIElement; Bindings.Add(prop.Name, _initBinding(prop.Name, ((TextEdit)_i.Content) as FrameworkElement, TextEdit.TextProperty)); break; case EUIAEditorType.IPEdit: _i.Content = new TextEdit(); ((TextEdit)_i.Content).MaskType = MaskType.RegEx; ((TextEdit)_i.Content).Mask = @"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; foreach (StringLengthAttribute propSL in prop.GetCustomAttributes(typeof(StringLengthAttribute), true)) { ((TextEdit)_i.Content).MaxLength = propSL.MaximumLength; } Bindings.Add(prop.Name, _initBinding(prop.Name, ((TextEdit)_i.Content) as FrameworkElement, TextEdit.TextProperty)); break; case EUIAEditorType.PassEdit: _i.Content = new PasswordBoxEdit(); Bindings.Add(prop.Name, _initBinding(prop.Name, ((PasswordBoxEdit)_i.Content) as FrameworkElement, PasswordBoxEdit.PasswordProperty)); break; case EUIAEditorType.DateEdit: _i.Content = new DateEdit(); Bindings.Add(prop.Name, _initBinding(prop.Name, ((DateEdit)_i.Content) as FrameworkElement, DateEdit.DateTimeProperty)); break; case EUIAEditorType.TextEdit: default: _i.Content = new TextEdit(); foreach (StringLengthAttribute propSL in prop.GetCustomAttributes(typeof(StringLengthAttribute), true)) { ((TextEdit)_i.Content).MaxLength = propSL.MaximumLength; } Bindings.Add(prop.Name, _initBinding(prop.Name, ((TextEdit)_i.Content) as FrameworkElement, TextEdit.TextProperty)); break; } _lg.Children.Add(_i); } } LayoutGroup _lgC = _lc.CreateGroup(); _lg.Children.Add(_lgC); Button _btnSave = new Button() { Content = "Применить" }; Button _btnCancel = new Button() { Content = "Отменить" }; LayoutItem li_Save = new LayoutItem() { Content = _btnSave }; LayoutItem li_Cancel = new LayoutItem() { Content = _btnCancel }; _btnSave.Click += _btnSave_Click; _btnCancel.Click += _btnCancel_Click; _lgC.Children.Add(li_Save); _lgC.Children.Add(li_Cancel); }