WorthlessCynomys Posted November 26, 2017 Share Posted November 26, 2017 Hy! I would like to make a dxDraw indicator that shows stamina. I wanted to make a picture, that fills up to a certain level based on a value, so I tried using dxDrawImageSection and RenderTarget too, but I couldn't make it. It is important that I want it to be relative, so like I have a 200x200 size picture that I draw in 80x80, or in 50x50 and so on based on the user's resolution. Could someone help me in this? Link to comment
Moderators IIYAMA Posted November 26, 2017 Moderators Share Posted November 26, 2017 Best scaling factor: (in my opinion) local screenWidth, screenHeight = guiGetScreenSize() local developmentScreenHeight = 1080 -- your resolution. local scaleFactor = screenHeight / developmentScreenHeight local imageSizeX, imageSizeY = 128 * scaleFactor, 128 * scaleFactor Do not scale over the X as because of the screen ratio. (except if it is for X position) With what are you filling it up? Because if it is just one colour then a rectangle is enough. Link to comment
WorthlessCynomys Posted November 27, 2017 Author Share Posted November 27, 2017 4 hours ago, IIYAMA said: Best scaling factor: (in my opinion) local screenWidth, screenHeight = guiGetScreenSize() local developmentScreenHeight = 1080 -- your resolution. local scaleFactor = screenHeight / developmentScreenHeight local imageSizeX, imageSizeY = 128 * scaleFactor, 128 * scaleFactor Do not scale over the X as because of the screen ratio. (except if it is for X position) With what are you filling it up? Because if it is just one colour then a rectangle is enough. It would be a shape. So like a muscle, that has an outline and a fill based on a value. Link to comment
Moderators IIYAMA Posted November 27, 2017 Moderators Share Posted November 27, 2017 Oke, show me what you got. Link to comment
WorthlessCynomys Posted November 27, 2017 Author Share Posted November 27, 2017 I deleted the code, since it wasnt successful. I have a picture of an arm, that i would like to draw from the bottom to the top. I can't show it to you since I'm from mobile now. What I need is the idea of making this. So i know that RenderTarget crops everything that would be outside its borders, but when i resized the renderTarget, it made the picture messy and full of pixels. Link to comment
Moderators IIYAMA Posted November 27, 2017 Moderators Share Posted November 27, 2017 When you are not on mobile. Show me all the content you have and show me the end result (with Photoshop/gimp), so that I can get a better idea of what you are trying to do. After that, I will give you instructions + the required information(incl. wiki links). You make your second iteration and I will give feedback with some code adjustments. Iterate, iterate, iterate etc. Easy Link to comment
WorthlessCynomys Posted November 27, 2017 Author Share Posted November 27, 2017 Okay, cool, thanks. I'Il be on PC like 20 hours from now. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now