

Work out the scale factors in the same way (using the ratio of object size to the window size) and then apply them to the view. Instead of scaling your board to match the new view size (which is the new window size), you could consider keeping the board co-ordinates the same by manipulating the view instead i.e. However, just for options, there is another choice (although it's very similar): Mister VistA, above, posted the answer I would probably use. This is a form of letter-boxing, which I pointed you in the direction of that code. You'll also need to use the same scaling factor for your chess piece size and positions as well. Personally, I would try to implement the second option. Just two quick and easy ways that I can think of to tackle this problem.

That will result in a game board that is 200x200 I instead of 200x400.Īlso, you'll probably want to take downsizing into consideration, in which case, I believe you'll want the lowest absolute scaling factor (as in absolute values). What you want to do is only use the lowest value (2) for both x and y scaling operations. For instance, if your board is 100x100 pixels, and your window is 100x100, then resizing your window to 200x400 will give you a scaling factor of 2 and 4 (respectively for x and y). This will keep a 1:1 aspect ratio and allow your board to grow without overshooting either the x or y axis. Obtain your scaling factor and then use the smallest factor for both dimensions. Of course, this isn't a downsize friendly option.Ģ. This would essentially allow more of the background to be displayed when the window size increases, while keeping the board the same size.

Keep the game board the original size and have a scaled background. There are two ways that I would try to accomplish this:ġ. Void updateScreen (sf :: RenderWindow &gameWindow, sf :: Sprite chessBoard ) resizeBoard (scaleXFactor, scaleYFactor ) Void resizeObjects (sf :: RenderWindow &gameWindow, Board chessBoard, sf :: Event event )įloat scaleXFactor = event. ResizeObjects (gameWindow, chessBoard, event ) type = sf :: Event :: Closed )Įlse if (event. Void checkInput (sf :: RenderWindow &gameWindow, Board chessBoard ) Sf :: RenderWindow gameWindow (sf :: VideoMode ( 700, 703, 24 ), "Chess" ) Void updateScreen (sf :: RenderWindow &, sf :: Sprite ) Void resizeObjects (sf :: RenderWindow &, Board chessBoard, sf :: Event ) Under Cells, click Distribute Rows or Distribute Columns.Void checkInput (sf :: RenderWindow &, Board chessBoard ) Rest the pointer on the column boundary until appears or the row boundary until appears, and then double-click it. If you have text in a table cell, the column must be as wide as or wider than the text. Rest the pointer on the column boundary that you want to move until appears, and then drag the boundary until the column is as wide as you want. If you have text in a table cell, the row must be the same height or taller than the text. Rest the pointer on the row boundary that you want to move until appears, and then drag the boundary until the row is the height that you want. Rest the pointer on any corner of the table until appears, and then drag the table boundary until the table is the size that you want. You can also resize one or more rows, columns, or individual cells in a table. You can resize a whole table to improve readability or to improve the visual effect of your document. Under Default cell spacing, select the Allow spacing between cells check box, and then enter the measurement that you want. Under Cell Size, click Distribute Rows or Distribute Columns.Ĭhange the space between cells in a tableĬlick the table, and then click the Table Layout tab.Ĭlick the Table tab, and then click Options. Select the columns or rows that you want to make the same size, and then click the Table Layout tab. Make multiple rows or columns the same size Tip: To display column width measurements on the horizontal ruler, click a cell, and then hold down OPTION as you drag the boundary.
