gordonramp Posted May 3, 2010 Share Posted May 3, 2010 How can I get a Hud to look the same at any screen resolution? Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
AndyGFX Posted May 3, 2010 Share Posted May 3, 2010 You need calc scale coef. for base screen resolution, then draw all HUD items multiplied by new scale (position and size). Quote [HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64 [sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx Link to comment Share on other sites More sharing options...
gordonramp Posted May 3, 2010 Author Share Posted May 3, 2010 Hi Andy, That sounds mathematically complicated. How about having a different image for each resolution? Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
AndyGFX Posted May 3, 2010 Share Posted May 3, 2010 Isn't comlicated. Example Base screen resolution = 1024x768 (HUD is designed for this res.) User defined resolution after start is now: 1280x1024 Math (new_res/base_res): hud_x_scale = 1280/1024 hud_y_scale = 1024/768 and for all HUD elements you need calc new position: new_x = hud_x_scale * item_x new_y = hud_y_scale * item_y and size: new_w = hud_x_scale * item_w new_h = hud_y_scale * item_h and draw it. Note: You don't need create different images when are designed for max resolution. Quote [HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64 [sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx Link to comment Share on other sites More sharing options...
gordonramp Posted May 3, 2010 Author Share Posted May 3, 2010 Thanks, I'll ponder that. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
Raul Posted May 3, 2010 Share Posted May 3, 2010 Hi Andy, That sounds mathematically complicated. How about having a different image for each resolution? This is completely zero. The HUD images have the same width and height on any resolution. You only need the position on screen. AndyGFX solution should be perfect for what you want. Quote i5 2.7Ghz, GTS 450, 8GB Ram, Win7 x64; Win8 x64 rvlgames.com - my games RVL Games Facebook Page, YouTube Channel Blitzmax Link to comment Share on other sites More sharing options...
paramecij Posted May 3, 2010 Share Posted May 3, 2010 Position AND scale the images if you want that the HUD elements to always occupy the same % of screen space. Like AndyGFX said Quote Link to comment Share on other sites More sharing options...
Andr3wHur5t Posted July 9, 2010 Share Posted July 9, 2010 ill post a small example tis is how i did it in lua DrawImage(Button,GraphicsWidth()/1.8,GraphicsHeight()/1.35,GraphicsWidth()/2.5,GraphicsHeight()/2.8) hope this helps. Quote Tools: AC3D | 3D Canvas(pro) | Texture Maker(pro) | Genetica(basic) | 3D World Studio | Fragmotion |Leadwerks 2 | XNA 4 | Visual Studio 2010 Professional | XCode 5.x |UU3D Pro Programing & Scripting Languages: C |C++ | C# | Obj-C | LUA | Javascript | PHP | Ruby Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.