public SimpleWindow(WpfGame scene, string title) { InitializeComponent(); Title = title; RootGrid.Children.Add(scene); }
public static void Register(WpfGame game, GameComponentCollection components) { _keyboardListener = new WpfKeyboardListener(game); _mouseListener = new WpfMouseListener(game); components.Add(new WpfInputListenerComponent(game, _keyboardListener, _mouseListener)); }
public SceneManager(WpfGame game) : base(game) { RootNode = new GroupNode("Root") { SceneManager = this, IsEditable = true, IsLockable = false }; }
public ArcBallCamera(WpfGame game, Vector3 lookAt, float currentZoom) : base(game) { Zoom = currentZoom; _lookAt = lookAt; UpdateOrder = (int)ComponentUpdateOrderEnum.Camera; }
public WpfKeyboardListener(WpfGame game, WpfKeyboardListenerSettings settings) { this.RepeatPress = settings.RepeatPress; this.InitialDelay = settings.InitialDelayMilliseconds; this.RepeatDelay = settings.RepeatDelayMilliseconds; _keyboard = new WpfKeyboard(game); }
/// <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; }
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)); } }
public MapRenderComponent(WpfGame game) : base(game) { _keyboard = new WpfKeyboard(game); _mouse = new WpfMouse(game) { CaptureMouseWithin = false }; _input = new InputModel(); }
/// <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; }
/// <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; }
public WpfMouseListener(WpfGame game, ViewportAdapter viewportAdapter) : this(game, new MouseListenerSettings()) => this.ViewportAdapter = viewportAdapter;
public WpfMouseListener(WpfGame game) : this(game, new MouseListenerSettings()) { }
public AnimationsContainerComponent(WpfGame game) : base(game) { UpdateOrder = (int)ComponentUpdateOrderEnum.Animation; }
public ResourceLibary(WpfGame game, PackFileService pf) : base(game) { _pf = pf; }
public SelectionComponent(WpfGame game) : base(game) { }
public Keyboard(WpfGame wpfGame) { _keyboard = new WpfKeyboard(wpfGame); }
public Keyboard(WpfGame game) { WpfKeyboard = new WpfKeyboard(game); }
public KeyboardComponent(WpfGame game) : base(game) { _wpfKeyboard = new WpfKeyboard(Game); UpdateOrder = (int)ComponentUpdateOrderEnum.Input; }
public GridComponent(WpfGame game) : base(game) { }
public FpsComponent(WpfGame game) : base(game) { }
public ObjectEditor(WpfGame game) : base(game) { }
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(); }
public TimingComponent(WpfGame game) : base(game) { _last2Seconds = new List <TimeSpan>(); }
public override WpfMouseListener CreateListener(WpfGame game) => new WpfMouseListener(game, this);
public FaceEditor(WpfGame game) : base(game) { }
public DebugInfo(WpfGame game) : base(game) { _game = game as MyGame; }
public WpfKeyboardListener(WpfGame game) : this(game, new WpfKeyboardListenerSettings()) { }