creating graphics to handle different resolutions.

BlitzMax Forums/BlitzMax Beginners Area/creating graphics to handle different resolutions.

You can load an image and set it to have smoothing/filtering so that when it is resized, if the OpenGL driver supports it, it will be resized very smoothly without any obvious `stretch marks` or weird areas where rows or colums seem to have been skipped. So that's the first thing you'll want to use - load the game board as a filtered image. It means that whenever you draw it at any given size/scale, it will still look good.

Then I think what you want to consider is creating a game board at the biggest resolution you want to support with detail, let's say, 1280x1024. Create the game board at that size with all its detail and glory. You then load in the image with ... I think it's the `FILTEREDIMAGE` flag. Then you open your Graphics screen at whatever resolution is available ... let's say you open it at 800x600. Then you need to use SetScale to set what size the image is going to be drawn. In this case, the X factor would be (800/1280) and the Y factor would be (600/1024). These will be floating point values. It will basically mean, in this case, to draw the image at a shrunken size. Then you simply DrawImage at 0,0 and the image should be drawn to fill the whole resolution, smoothly filtered and shrunk down to fit the whole screen.

The reason you want to start out with an original image at a high resolution is so that you ensure you get good-looking detail on high resolution screens. If someone tries to play your game at 1600x1200 for example, you can scale up using the same formulate (xresolution/originalxresolution and yresolution/originalyresolution). It will then be stretched, but not by too much to make it look bad.

So I'd say go for a high-resolution original image for your game board, load it with filtering enabled, set the scale to the appropriate amount so that it stretches or shrinks depending on the resolution, then draw the image.

You might want to do something similar with your objects that move around or are updated on the screen .. is scale them using the same values you used in the SetScale for resizing the main board. You also will have to multiply any X or Y coordinates by those scale factors as well to make sure you are drawing to the right location in proportion.

In 3D games this is basically the same thiing that happens. An image is defined at a certain coordinate relative to how much of the scene the camera lense is looking at, and then regardless of the resolution it will always occupy the same amount of screen space.