Exemplo n.º 1
0
        public SimpleWindow(WpfGame scene, string title)
        {
            InitializeComponent();

            Title = title;
            RootGrid.Children.Add(scene);
        }
Exemplo n.º 2
0
        public static void Register(WpfGame game, GameComponentCollection components)
        {
            _keyboardListener = new WpfKeyboardListener(game);
            _mouseListener    = new WpfMouseListener(game);

            components.Add(new WpfInputListenerComponent(game, _keyboardListener, _mouseListener));
        }
Exemplo n.º 3
0
 public SceneManager(WpfGame game) : base(game)
 {
     RootNode = new GroupNode("Root")
     {
         SceneManager = this, IsEditable = true, IsLockable = false
     };
 }
Exemplo n.º 4
0
        public ArcBallCamera(WpfGame game, Vector3 lookAt, float currentZoom) : base(game)
        {
            Zoom    = currentZoom;
            _lookAt = lookAt;

            UpdateOrder = (int)ComponentUpdateOrderEnum.Camera;
        }
Exemplo n.º 5
0
 public WpfKeyboardListener(WpfGame game, WpfKeyboardListenerSettings settings)
 {
     this.RepeatPress  = settings.RepeatPress;
     this.InitialDelay = settings.InitialDelayMilliseconds;
     this.RepeatDelay  = settings.RepeatDelayMilliseconds;
     _keyboard         = new WpfKeyboard(game);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Creates a new instance of the keyboard helper.
        /// </summary>
        /// <param name="focusElement">The element that will be used as the focus point. Provide your implementation of <see cref="WpfGame"/> here.</param>
        public WpfKeyboard(WpfGame focusElement)
        {
            if (focusElement == null)
            {
                throw new ArgumentNullException(nameof(focusElement));
            }

            _focusElement = focusElement;
        }
Exemplo n.º 7
0
        public RenderEngineComponent(WpfGame game) : base(game)
        {
            UpdateOrder = (int)ComponentUpdateOrderEnum.RenderEngine;
            DrawOrder   = (int)ComponentDrawOrderEnum.RenderEngine;

            foreach (RenderBuckedId value in Enum.GetValues(typeof(RenderBuckedId)))
            {
                _renderItems.Add(value, new List <IRenderItem>(100));
            }
        }
Exemplo n.º 8
0
        public MapRenderComponent(WpfGame game)
            : base(game)
        {
            _keyboard = new WpfKeyboard(game);
            _mouse    = new WpfMouse(game)
            {
                CaptureMouseWithin = false
            };

            _input = new InputModel();
        }
Exemplo n.º 9
0
 /// <summary>
 /// Creates a new instance of the mouse helper.
 /// </summary>
 /// <param name="focusElement">The element that will be used as the focus point. Provide your implementation of <see cref="WpfGame"/> here.</param>
 public WpfMouse(WpfGame focusElement)
 {
     _focusElement             = focusElement ?? throw new ArgumentNullException(nameof(focusElement));
     _focusElement.MouseWheel += HandleMouse;
     // movement
     _focusElement.MouseMove  += HandleMouse;
     _focusElement.MouseEnter += HandleMouse;
     _focusElement.MouseLeave += HandleMouse;
     // clicks
     _focusElement.MouseLeftButtonDown  += HandleMouse;
     _focusElement.MouseLeftButtonUp    += HandleMouse;
     _focusElement.MouseRightButtonDown += HandleMouse;
     _focusElement.MouseRightButtonUp   += HandleMouse;
 }
Exemplo n.º 10
0
        /// <summary>
        /// Creates a new instance of text to be drawn in SCREEN COORDINATES.
        /// </summary>
        /// <param name="game"></param>
        /// <param name="text"></param>
        /// <param name="position">NOT PIXELS, but SCREEN COORDINATES (0,0) is top left, (1,0) is top right, (1,1) bottom right, (0.5,0.5) is center, etc.</param>
        /// <param name="h"></param>
        /// <param name="v"></param>
        public TextComponent(WpfGame game, string text, Vector2 position, HorizontalAlignment h = HorizontalAlignment.Left, VerticalAlignment v = VerticalAlignment.Top) : base(game)
        {
            if (string.IsNullOrEmpty(text))
            {
                throw new ArgumentNullException(nameof(text));
            }
            if (h == HorizontalAlignment.Stretch || v == VerticalAlignment.Stretch)
            {
                throw new NotSupportedException("Text cannot be stretched in monogame");
            }

            Text      = text;
            _position = position;
            _h        = h;
            _v        = v;
        }
 public MouseComponent(WpfGame game) : base(game)
 {
     _wpfMouse = new WpfMouse(game);
     _wpfMouse.CaptureMouseWithin = true;
     UpdateOrder = (int)ComponentUpdateOrderEnum.Input;
 }
Exemplo n.º 12
0
 public WpfMouseListener(WpfGame game, ViewportAdapter viewportAdapter) : this(game, new MouseListenerSettings()) => this.ViewportAdapter = viewportAdapter;
Exemplo n.º 13
0
 public WpfMouseListener(WpfGame game) : this(game, new MouseListenerSettings())
 {
 }
 public AnimationsContainerComponent(WpfGame game) : base(game)
 {
     UpdateOrder = (int)ComponentUpdateOrderEnum.Animation;
 }
Exemplo n.º 15
0
 public ResourceLibary(WpfGame game, PackFileService pf) : base(game)
 {
     _pf = pf;
 }
 public SelectionComponent(WpfGame game) : base(game)
 {
 }
Exemplo n.º 17
0
 public Keyboard(WpfGame wpfGame)
 {
     _keyboard = new WpfKeyboard(wpfGame);
 }
Exemplo n.º 18
0
 public Keyboard(WpfGame game)
 {
     WpfKeyboard = new WpfKeyboard(game);
 }
 public KeyboardComponent(WpfGame game) : base(game)
 {
     _wpfKeyboard = new WpfKeyboard(Game);
     UpdateOrder  = (int)ComponentUpdateOrderEnum.Input;
 }
Exemplo n.º 20
0
 public GridComponent(WpfGame game) : base(game)
 {
 }
Exemplo n.º 21
0
 public FpsComponent(WpfGame game) : base(game)
 {
 }
 public ObjectEditor(WpfGame game) : base(game)
 {
 }
Exemplo n.º 23
0
 public Mouse(WpfGame wpfGame)
 {
     WpfMouse = new WpfMouse(wpfGame);
 }
 public ClearScreenComponent(WpfGame game) : base(game)
 {
     DrawOrder = (int)ComponentDrawOrderEnum.ClearScreenComponent;
 }
        private static void OpenCustomWindow(WpfGame game, string title)
        {
            var w = new SimpleWindow(game, title);

            w.Show();
        }
Exemplo n.º 26
0
 public TimingComponent(WpfGame game) : base(game)
 {
     _last2Seconds = new List <TimeSpan>();
 }
Exemplo n.º 27
0
 public override WpfMouseListener CreateListener(WpfGame game) => new WpfMouseListener(game, this);
 public FaceEditor(WpfGame game) : base(game)
 {
 }
Exemplo n.º 29
0
 public DebugInfo(WpfGame game) : base(game)
 {
     _game = game as MyGame;
 }
Exemplo n.º 30
0
 public WpfKeyboardListener(WpfGame game)
     : this(game, new WpfKeyboardListenerSettings())
 {
 }