Simple way to keep scale of your GUI regardless of resolution by TFE22nd Nov 2010 20:32
|
---|
Summary A function to make your game interface look exactly the same in all resolutions. Description This set of two functions work as multipliers for any coordinates in your program. Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com ``Use function width = 1680 height = 1050 set display mode width, height, 32, 1 ``set any display mode you want basewidth = 1024 ``this is the mode for which you GUI was designed baseheight = 768 xMultiplier(1280,basewidth) yMultiplier(1050,baseheight) do box 50 * xMulti, 50 * yMulti, 500 * xMulti, 500 * yMulti rem this box will have the exact same size in any resolution wait key end ``Declare functions function xMultiplier(x,basex) xMulti = x / basex endfunction xMulti function yMultiplier(y,basey) yMulti = y / basey endfunction yMulti |