Jump to content

Re-sizing a tex file to the screen size


epsilonion
 Share

Recommended Posts

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.. :D

 

 

thank you in advance..

Link to comment
Share on other sites

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.

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

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...

 

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...