Esempio n. 1
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            FontBank fontBank = new FontBank();

            fontBank.Load(this.Content, "Fonts");

            IFontScaler fontScaler = new SimpleFontScaler(fontBank);

            var textEntity = new TextEntity()
            {
                Colour    = Color.Cyan,
                Text      = "This is a test.",
                Bounds    = new RectangleF(100, 100, 100, 25),
                FontName  = "Calibri",
                FontSize  = 20,
                Behaviour = TextEntityBehaviour.AutoScale,
            };

            var textEntityView = new TextEntityView(
                textEntity,
                fontScaler,
                _spriteBatch,
                fontBank
                );

            var textEntityEditorView = new EditorView(
                textEntityView,
                _spriteBatch
                );

            _views.Add(textEntityEditorView);
            _controllers.Add(new EditorViewController(textEntityEditorView));
            _controllers.Add(new TextEntityViewController(textEntityView, _graphics.GraphicsDevice, _spriteBatch));
        }
Esempio n. 2
0
 public TextEntityViewController(TextEntityView view, GraphicsDevice device, SpriteBatch spriteBatch)
 {
     _view        = view ?? throw new ArgumentNullException();
     _device      = device ?? throw new ArgumentNullException();
     _spriteBatch = spriteBatch ?? throw new ArgumentNullException();
 }