epsilonion Posted January 8, 2015 Share Posted January 8, 2015 I am wondering if there is a way to re-size a image that is displayed with the drawImage function? Basically the image for the background of my menu should re-size if the screen is windows or in full-screen. the picture should be able to be resized to the resolution of the monitor etc etc.. it just looks more professional if someones got a very high resolution and your in full screen and your background image only covers half the background.. any help would be great.. thank you in advance.. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 8, 2015 Share Posted January 8, 2015 The drawImage command has extra parameters to specify the scale. Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted January 8, 2015 Share Posted January 8, 2015 This is what I have for scaling my box (when used) --HUD Bar context:SetColor(1,1,1,1) context:DrawImage(self.image.wood,0,980,1920,50) SetColor: obviously sets the color of the box and has an alpha channel for fading DrawRect(X-position, Y-position,X-scale,Y-scale) my example sets a bar all the way across the bottom of the screen. Those numbers are a 1920X1080 screen. I havnt figured out the local function but if there is anything below this such as other text displayed, other images the use function they all inherite the color set above so they needed a new SetColor: function to set them back. Im sure thats my fault because I havnt a clue what Im doing but thats how I managed to fix it. Here is where I get my commands from. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
gamecreator Posted January 8, 2015 Share Posted January 8, 2015 You can also use SetScale Quote Link to comment Share on other sites More sharing options...
epsilonion Posted January 8, 2015 Author Share Posted January 8, 2015 Think I have figured it out.... You would have to use the Window::GetHeight command (gets the outer height of the current window in pixels, and Window::GetWidth gets the width of the current window outer width in pixels, then you would have to drawImage to fit the screen, usefull if you have a settings options for windowed and full screen... Quote Link to comment Share on other sites More sharing options...
Josh Posted January 8, 2015 Share Posted January 8, 2015 Use Context:GetWidth()/Height() instead of the window. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
epsilonion Posted January 8, 2015 Author Share Posted January 8, 2015 Thank you.. I must say I am getting my head around this now... I thought it would take longer since I have not touched any code for over 15 years.. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted January 8, 2015 Share Posted January 8, 2015 Things come back to you quicker than you think. Though a large part of that is also thanks to how easy it is to code with Leadwerks. Quote 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.