Print to page

Hi there. I want to create an application to allow someone to design table top board games. The ideas is you can add floor textures, add walls and then drag drop images to add detail such as tables, bloody splats cars, all from a top down perspective. Users can then print them out onto paper. I started doing some feasibility in c# winforms using gdi+.

However I have now decided the board designs would look much better if light sources could be added which will illuminate all the graphics around it and maybe cast shadows (maybe also use normal maps). I think gdi+ library wouldn’t be capable of this. So I was thinking maybe using monogame.

I haven’t used it yet but have experience in C#. Can any users please tell me if this would be possible ( which I’m sure it will be) and more importantly tell me if it will be possible to then somehow send the ‘map’ to a file for ready formatted for printing (large maps should be automatically split across multiple A4 pages, or whatever size the user chooses)

Any tips or links to what might help would be great.

To all of this, yes it is possible. But first things first, fibd a tutorial that fits your needs/tastes about lighting (gouraud shading, or phong shading, lanbert lighting, deferred, PBR, or anything) :wink:

This app and irs features represents a certain amount of work, fyi.

Thanks for the reply. Good to hear it would all be doable. I plan to start with the basics and not worry about lighting etc, just get simple dragging dropping of images working and printing will be my first phase.

Printing was my main concern as its not something games would typically do, and doing some searches i cannot find any information on printing. Do you have any links/ information on printing?

There’s no support for printing of any kind in MonoGame itself.

You’ll want to render a design to a RenderTarget2D, which is basically an image you can draw to. Then you can save that render target to an image file using SaveAsJpeg or SaveAsPng.

There is some printing support in .NET in case you want to handle printing from your code. Googling .NET printing should get you on your way. I’ve never done this, so I don’t know how it works.

1 Like

Excellent that sounds like an ideal solution… I’ll look into that.

I assume you can’t easily use monogame within winforms, like a monogame control?

This was just posted by another user, it’s but one library for 2d lighting there are many more if you need some starting help.
There are a bunch of implementations for 2d shadows, too, but I don’t have one in the back of my mind right now.

I think you mean https://github.com/discosultan/penumbra for example.

You can! I don’t have a project handy though, maybe someone else does.

@TheGrovesy seach the forum for more links like this one:

You may want to do a simple lookup on Google with the following key-words…

c# printing images
c# printing images tools

There is plenty of information out there…