CodeBase - Simple way to keep scale of your GUI regardless of resolution

Return to the CodeBase listing

Category: Display

Version: 1.0

0
0

Information

Uploaded: 22nd Nov 2010 20:32

Modified: 22nd Nov 2010 20:36

Author:  TFE

Summary

A function to make your game interface look exactly the same in all resolutions.

Full Description

This set of two functions work as multipliers for any coordinates in your program. <br /> <br /> By simply dividing your current x/y resolution with the base x/y resolution you choose, you get the multiplier you should use. <br /> e.g. (as in the code) 1680/1024 = Multiplier which is approx 1.64<br /> <br /> then simply multiply all your x coordinates with the xMulti and the y coordinates with the yMulti<br /> <br /> If the current resolution is higher than the base, all coordinates will be scaled up to compensate for the smaller pixels and vise versa.

Comments

No comments yet.