-
Notifications
You must be signed in to change notification settings - Fork 27
FDEF831D
Inherit from this class in your custom class to create a draw control with a game loop, which is selectable from the ToolBox during design time. It provides a game loop and a place to draw.
This game loop control is useful as a window, which needs a classical game loop for complex GameTime based mechanics.
Namespace: MonoGame.Forms.NET.Controls
Assembly: MonoGame.Forms.NET (in MonoGame.Forms.NET.dll) Version: 3.2.0
C#
public abstract class MonoGameControl : GameControl
Inheritance | Object → MarshalByRefObject → Component → Control → GraphicsDeviceControl → GameControl → MonoGameControl |
MonoGameControl | Initializes a new instance of the MonoGameControl class |
AlwaysEnableKeyboardInput | If enabled the Keyboard input will work even if the current control has no focus (mouse cursor is outside of the control). (Inherited from GraphicsDeviceControl) |
BackColor | Set the background color of this Control in the designer. (Inherited from GraphicsDeviceControl) |
Components | Get the GameComponentCollection. (Inherited from GraphicsDeviceControl) |
Editor | The MonoGameService of the MonoGameControl draws and updates the actual content of the update control. |
ForeColor | Set the foreground color of this Control in the designer. (Inherited from GraphicsDeviceControl) |
GraphicsProfile | Set the GraphicsProfile in the property grid during Design-Time (HiDef or Reach). You shouldn't change this during runtime! (Inherited from GraphicsDeviceControl) |
IsMouseInsideControl | Returns true when the mouse cursor is inside the control. (Inherited from GraphicsDeviceControl) |
MouseHoverUpdatesOnly | Set this to 'true' to only update this control when the mouse cursor is inside (OnMouseHover).
This technique is useful when you only need to update this control temporarily or always on demand. Setting this property to 'true' will cause that this control will only consume CPU power to update its contents, when the mouse cursor is inside it or when you call 'RunOneFrame();' manually. |
Services | Get the GameServiceContainer. (Inherited from GraphicsDeviceControl) |
SwapChainRenderTarget | A swap chain used for rendering to a secondary GameWindow. Note: When working with different RenderTarget2D, you need to set the current render target back to the SwapChainRenderTarget as this is the real 'Back Buffer'. 'GraphicsDevice.SetRenderTarget(null)' will NOT work as you are doing usally in MonoGame. Instead use 'GraphicsDevice.SetRenderTarget(SwapChainRenderTarget)'. Otherwise you will see only a black control window. (Inherited from GraphicsDeviceControl) |
Dispose | Disposes the contents of the attached Editor. (Overrides GraphicsDeviceControl.Dispose(Boolean)) |
Draw | Override to implement Drawing logic in your custom MonoGame.Forms.Control. |
Initialize | Override to implement Initialization logic in your custom MonoGame.Forms.Control. |
IsMouseInsideControlArea | Returns true when the mouse cursor is inside the specific area. (Inherited from GraphicsDeviceControl) |
OnClientSizeChanged | Updates related Editor services when the ClientSize changes. (Overrides GraphicsDeviceControl.OnClientSizeChanged(EventArgs)) |
OnCreateControl |
(Inherited from GraphicsDeviceControl) |
OnMouseEnter |
(Inherited from GraphicsDeviceControl) |
OnMouseLeave |
(Inherited from GraphicsDeviceControl) |
OnMouseWheel |
(Inherited from GraphicsDeviceControl) |
OnPaint |
(Inherited from GraphicsDeviceControl) |
OnPaintBackground |
(Inherited from GraphicsDeviceControl) |
OnVisibleChanged | In case the ClientSize was changed before activating the window, the cam position gets updated according to this changes. (Overrides Control.OnVisibleChanged(EventArgs)) |
PaintUsingSystemDrawing |
(Inherited from GraphicsDeviceControl) |
RunFrames | Run a specific amount of frames before the game loop falls to sleep again. The bool MouseHoverUpdatesOnly must be set to 'true' before.
This could be helpful if some update mechanics are needing longer to update but doesn't need to run continuously afterwards. |
RunOneFrame | Runs exactly one frame by internally calling 'Invalidate();' one single time. This will run the game loop only once and immediately shows the result. (Inherited from GameControl) |
SetMultiSampleCount | Set the "MultiSampleCount" for Multi Sampled AntiAlising (MSAA). The input value will be automatically clamped to the nearest power of two in relation of what the users GraphicsDevice can handle. (Inherited from GraphicsDeviceControl) |
Update | Override to implement Update (Game Loop) logic in your custom MonoGame.Forms.Control. |
ComponentState | Subscribe to get Update and Draw event info for all GameComponents (IUpdatable, IDrawable). (Inherited from GraphicsDeviceControl) |
ControlState | Subscribe to get Update and Draw event info for this MonoGameControl. |
MultiSampleCountRefreshed | Subscribe to this event to react to MultiSampleCount changes in your custom controls. (Inherited from GraphicsDeviceControl) |
OnMouseWheelDownwards | Scroll the mouse wheel downwards to trigger this event. (Inherited from GraphicsDeviceControl) |
OnMouseWheelUpwards | Scroll the mouse wheel upwards to trigger this event. (Inherited from GraphicsDeviceControl) |
-
Welcome to MonoGame.Forms!
- MonoGame.Forms.NET Namespace
- MonoGame.Forms.NET.Components Namespace
- MonoGame.Forms.NET.Components.Interfaces Namespace
-
MonoGame.Forms.NET.Controls Namespace
- GameControl Class
- GraphicsDeviceControl Class
- GraphicsDeviceControl.MouseWheelDownwardsEvent Delegate
- GraphicsDeviceControl.MouseWheelUpwardsEvent Delegate
- InvalidationControl Class
- MonoGameControl Class
-
MonoGame.Forms.NET.Services Namespace
-
EditorService Class
- EditorService Constructor
-
EditorService Properties
- BackgroundColor Property
- Camera Property
- Content Property
- Font Property
- FontHeight Property
- FPSCounter Property
- GetAbsoluteMousePosition Property
- GetCurrentMultiSampleCount Property
- GetRelativeMousePosition Property
- GetRenderTargetManager Property
- GraphicsDevice Property
- Pixel Property
- ResourceContent Property
- spriteBatch Property
- SwapChainRenderTarget Property
-
EditorService Methods
- AddDefaultComponents Method
- BeginAntialising Method
- BeginCamera2D Method
- BeginRenderTarget Method
- CamMove Method
- CamRotate Method
- CamZoom Method
- DisableRenderTargets Method
- Dispose Method
- EndAntialising Method
- EndCamera2D Method
- EndRenderTarget Method
- GetCamRotation Method
- GetCamZoom Method
- RemoveAllComponents Method
- RemoveDefaultComponents Method
- ResetCam Method
- ResourceContentManagerInitialize Method
- EditorService Events
- EditorService.RenderTargetManager Class
- EditorService.RenderTargetManager.RenderTarget2DHelper Class
- InvalidationService Class
- MonoGameService Class
-
EditorService Class