Ok fine. Please try the following:
Place this code block:
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
}
in the MapHost class and place a breakpoint inside this method.
See if it can reach this breakpoint.
Ok fine. Please try the following:
Place this code block:
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
}
in the MapHost class and place a breakpoint inside this method.
See if it can reach this breakpoint.
I added that in and placed a breakpoint, but it still doesnāt seem to be working. Very weird.
Itās possible that the controls may not have input focus.
Letās try this:
Put this code block additionally:
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter(e);
if (!Focused) Focus();
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
if (Focused) Parent.Focus();
}
in the MapHost class and test these events as well as the mouse wheel events from the previous posts.
That did it! Upon adding those, it hits the breakpoint I added in OnMouseWheel.
Thank you so much! 
This is great
Iām glad I could help.
Can you confirm that the breakpoints in OnMouseWheelUpwards and OnMouseWheelDownwards are working too now?
Yeah, both of those are working now as well.
Okay nice.
I already applied a patch on the dev branch (not public). It will be available on the master branch in the next iteration of MonoGame.Forms, so you donāt need to fiddle around with OnMouseEnter and OnMouseLeave in your custom controls.
I will push out along other improvements soon.
Thanks for reporting the issue @mgtaa!
NuGet: NuGet Gallery | MonoGame.Forms 1.6.7.1
Better readable debug panel:
This fixes a bug where resizing a control also resizes the BackBuffer- Width and Height for other controls (because they werenāt updated accordingly).
Hi, Iām very interested in this, as Iām making a GameBoy emulator and Iām going to use MonoGame for the rendering and sound, and WinForms for the UI controls and GameBoy debugger.
Someone said WinForms uses GDI+ and therefore MonoGame will be slow. Is this true? I really have no idea about MonoGame nor WinForms so I canāt answer this question myself.
Thanks.
Even when embedded in WinForms, MonoGame will use DirectX or OpenGL for rendering, so MG will not run slower than usual.
This may sound like a ādumbā question but could someone explain exactly what MonoGame-Forms is.
Is this a way to add a complete GUI to your MonoGame Project?
Thank youā¦
No, this is exactly not the purpose of MonoGame.Forms.
To quote the headline of the readme file:
MonoGame.Forms is the easiest way of integrating a MonoGame render window into your
Windows Forms project. It should make your life much easier, when you
want to create your own editor environment.
So the purpose of MonoGame.Forms is - for example - creating your own editor tool, which needs a rendering window, for your own game.
This could be a level editor or a particle effect editor for example.
You basically create a new WindowsForms project and then add the MonoGame.Forms library to this project, to make the rendering capabillities of the MonoGame.Framework available in your editor project in a very easy way.
Also what @KiloMikeCodesStuff said should be possible. Creating your GameBoy emulator with MonoGame.Forms should be very doable, when you know how to render your contents using the MonoGame.Framework. Everything else is just the usual business of WindowsForms (working with a complete GUI solution for projects like that).
I also reccommend reading the README file and the Wiki (which describes the class library) to get a better overview.
Regarding developing games inside MonoGame.Forms: Yes, itās kinda possible. The library has native Keyboard and GamePad support of the MonoGame.Framework as well as RenderTarget support. However it only supports the Windows platform and I have never tested things like fullscreen support and different resolutions (but itās possible to resize the render controls), because - as I said - this is not the purpose of the MonoGame.Forms library.
I recommend using the MonoGame.Forms library for tools and editors only. Not for whole games on a bigger scope.
Thank you for your informative reply, sqrMin1⦠
So then, if I am ever able to complete my military simulation, I could then use this library to create, for example, a scenario editor. Is this a better understanding of your software?
Yes, you could do that, but it realy depends on your needs.
For example: itās also possible to create a scenario editor without the need of a rendering window, as long as such an editor only needs to process and handle plain data.
But if you need a graphical / rendered representation of such data (which includes realtime updates), then MonoGame.Forms is there to help you with that.
NuGet: NuGet Gallery | MonoGame.Forms 1.6.7.1
Easy to work with MultiSampling in MonoGame.Forms:
Use Antialising (MSAA) in your custom controls like this:
protected override void Initialize()
{
base.Initialize();
SetMultiSampleCount(8); //Usual numbers are 0, 2, 4, 8
}
protected override void Draw()
{
base.Draw();
Editor.BeginAntialising();
Editor.spriteBatch.Begin();
//Your drawings
Editor.spriteBatch.End();
Editor.EndAntialising();
}
As you can see, everything between
BeginAntialising()andEndAntialising()will be affected by MSAA.
Dev Note for the next Build (1.6.7.0):
Planning to implement a RenderTarget Manager where users can add their custom RenderTargets to, so they becoming automatically updated internally (based on the ClientSize for example).
protected override void Initialize()
{
base.Initialize();
// Adding a new Rendertarget2D with the keyname "MyTarget" to the Manager
Editor.GetRenderTargetManager.CreateNewRenderTarget2D("MyTarget", false);
}
public override void Draw()
{
// Set the new RenderTarget
Editor.BeginRenderTarget("MyTarget", clearColor: Color.Transparent);
// Your Drawings ...
// Automatically revert to the SwapChainRenderTarget
Editor.EndRenderTarget("MyTarget", drawToSpriteBatch: false, clearGraphics: false);
}