Ejemplo n.º 1
0
        public ColorPicker(IContentChest contentChest, Vector2 position, int width, int segments, float scale)
        {
            _contentChest = contentChest;
            _position     = position;
            _width        = width;
            _segments     = segments;

            _hueSlider        = AddChild(new Slider(contentChest, position, 0, 100, _hue, width, scale));
            _saturationSlider = AddChild(new Slider(contentChest, position + new Vector2(0, Height + Margin), 0, 100, _saturation,
                                                    width, scale));
            _valueSlider = AddChild(new Slider(contentChest, position + new Vector2(0, Height + Margin + Height + Margin), 0, 100,
                                               _value, width, scale));

            _hueSlider.Changed += () =>
            {
                _hue = _hueSlider.GetValue();
                Changed?.Invoke();
            };
            _saturationSlider.Changed += () =>
            {
                _saturation = _saturationSlider.GetValue();
                Changed?.Invoke();
            };
            _valueSlider.Changed += () =>
            {
                _value = _valueSlider.GetValue();
                Changed?.Invoke();
            };

            Bounds = new Rectangle((int)position.X, (int)position.Y, width,
                                   Height + Margin + Height + Margin + Height);
        }
Ejemplo n.º 2
0
        public TextBox(IContentChest contentChest, IKeyboardDispatcher keyboardDispatcher, Vector2 position,
                       SpriteFont font, int width)
        {
            _keyboardDispatcher = keyboardDispatcher;
            _font = font;

            var(x, y) = position;
            Bounds    = new Rectangle((int)x, (int)y, width, 30);

            _keyboardDispatcher.SubscribeToAnyKeyPress(OnKeyPressed);


            _nineSlice = new NineSlice(contentChest.Get <Texture2D>("UI/title_menu_buttons"),
                                       new Dictionary <Segment, Rectangle>
            {
                { Segment.TopLeft, new Rectangle(233, 4, 1, 1) },
                { Segment.Top, new Rectangle(234, 4, 1, 1) },
                { Segment.TopRight, new Rectangle(235, 4, 1, 1) },
                { Segment.Right, new Rectangle(235, 5, 1, 1) },
                { Segment.BottomRight, new Rectangle(235, 6, 1, 1) },
                { Segment.Bottom, new Rectangle(234, 6, 1, 1) },
                { Segment.BottomLeft, new Rectangle(233, 6, 1, 1) },
                { Segment.Left, new Rectangle(233, 5, 1, 1) },
                { Segment.Center, new Rectangle(234, 5, 1, 1) },
            });
        }
Ejemplo n.º 3
0
        public SanctuaryGame(IContentChest contentChest, IViewManager viewManager, IApplicationFolder applicationFolder,
                             IKeyboardDispatcher keyboardDispatcher, IMouseManager mouseManager, Cursor cursor,
                             IOptionsManager optionsManager)
        {
            _contentChest       = contentChest;
            _viewManager        = viewManager;
            _applicationFolder  = applicationFolder;
            _keyboardDispatcher = keyboardDispatcher;
            _mouseManager       = mouseManager;
            _cursor             = cursor;
            _optionsManager     = optionsManager;

            _graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = 1280,
                PreferredBackBufferHeight = 720
            };

            Window.AllowUserResizing  = true;
            Window.ClientSizeChanged += WindowOnClientSizeChanged;

            IsMouseVisible = false;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            _viewManager.Graphics = _graphics;
            //InitializeSteam();
        }
Ejemplo n.º 4
0
 public MainOptionsMenu(IContentChest contentChest, IViewPortManager viewManager, IUserInterface userInterface, IContentLoader <AsepriteSpriteMap> spriteMapLoader)
 {
     _contentChest    = contentChest;
     _viewPortManager = viewManager;
     _userInterface   = userInterface;
     _spriteMapLoader = spriteMapLoader;
 }
Ejemplo n.º 5
0
        public void SetUp()
        {
            _sceneManager = Substitute.For <ISceneManager>();
            _contentChest = Substitute.For <IContentChest>();
            _viewManager  = Substitute.For <IViewPortManager>();

            _transitionManager = new TransitionManager(_sceneManager, _contentChest, _viewManager);
        }
Ejemplo n.º 6
0
 public SplashScene(
     IViewPortManager viewPortManager,
     IContentChest contentChest,
     IContentLoader <AsepriteSpriteMap> spriteMapLoader)
 {
     _viewPortManager = viewPortManager;
     _contentChest    = contentChest;
     _spriteMapLoader = spriteMapLoader;
 }
Ejemplo n.º 7
0
        public MenuScene(IContentChest contentChest, IViewPortManager viewPortManager,
                         CharacterCreationMenu characterCreationMenu,
                         TitleMenu mainTitleMenu, MainOptionsMenu mainOptionsMenu)
        {
            _contentChest          = contentChest;
            _viewPortManager       = viewPortManager;
            _characterCreationMenu = characterCreationMenu;
            _mainTitleMenu         = mainTitleMenu;
            _mainOptionsMenu       = mainOptionsMenu;

            _activeMenu = _mainTitleMenu;
        }
Ejemplo n.º 8
0
 public ScrollBox(IContentChest contentChest, string textContent, Rectangle bounds)
 {
     _contentChest = contentChest;
     _font         = _contentChest.Get <SpriteFont>("Fonts/InterfaceFont");
     Bounds        = bounds;
     _lines        = WrapString(textContent);
     _nibSprite    = new Sprite(_contentChest.Get <Texture2D>("UI/title_menu_buttons"),
                                new Rectangle(192, 14, 10, 30));
     _upArrowSprite = new Sprite(_contentChest.Get <Texture2D>("UI/title_menu_buttons"),
                                 new Rectangle(192, 4, 10, 10));
     _downArrowSprite = new Sprite(_contentChest.Get <Texture2D>("UI/title_menu_buttons"),
                                   new Rectangle(202, 4, 10, 10));
 }
Ejemplo n.º 9
0
        public Slider(IContentChest contentChest, Vector2 position, float minValue, float maxValue, float startingValue, int width, float scale)
        {
            _minValue     = minValue;
            _maxValue     = maxValue;
            _currentValue = startingValue;
            _width        = width;
            _scale        = scale;

            _sliderSource = new Rectangle(34, 189, 10, 10);
            _texture      = contentChest.Get <Texture2D>("UI/title_menu_buttons");

            var(x, y) = position;
            Bounds    = new Rectangle((int)x, (int)y, width, 10);
        }
 public CharacterCreationMenu(IContentChest contentChest, IPlayerMaker playerMaker,
                              IViewPortManager viewPortManager, IKeyboardDispatcher keyboardDispatcher, IUserInterface userInterface,
                              IOptionsManager optionsManager, IContentLoader <IReadOnlyCollection <Hair> > hairContentLoader,
                              IContentLoader <IReadOnlyCollection <Head> > headContentLoader,
                              IContentLoader <IReadOnlyCollection <Eyes> > eyeContentLoader,
                              IContentLoader <AsepriteSpriteMap> spriteMapLoader,
                              ICharacterRenderer characterRenderer)
 {
     _contentChest        = contentChest;
     _playerMaker         = playerMaker;
     _viewPortPortManager = viewPortManager;
     _keyboardDispatcher  = keyboardDispatcher;
     _userInterface       = userInterface;
     _optionsManager      = optionsManager;
     _hairContentLoader   = hairContentLoader;
     _headContentLoader   = headContentLoader;
     _eyeContentLoader    = eyeContentLoader;
     _spriteMapLoader     = spriteMapLoader;
     _characterRenderer   = characterRenderer;
 }
Ejemplo n.º 11
0
 public Cursor(IContentChest contentChest, IMouseManager mouseManager)
 {
     _contentChest = contentChest;
     _mouseManager = mouseManager;
 }
Ejemplo n.º 12
0
 public TransitionManager(ISceneManager sceneManager, IContentChest contentChest, IViewPortManager viewPortManager)
 {
     _sceneManager    = sceneManager;
     _contentChest    = contentChest;
     _viewPortManager = viewPortManager;
 }
Ejemplo n.º 13
0
 public AsepriteSpriteMapLoader(IContentChest contentChest, IContentDeserializer contentDeserializer)
 {
     _contentChest        = contentChest;
     _contentDeserializer = contentDeserializer;
 }
Ejemplo n.º 14
0
 public GameScene(IContentChest contentChest)
 {
     _contentChest = contentChest;
 }