Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

Changing position of UI elements with different resolutions


LoLPos
Go to solution Solved by TMP4,

Question

Posted (edited)

Version of Files 40k

 

Hello, im trying to move the yangbox close to the minimap. I moved it to the place with my resolution of 2560x1440, but when i launch the game in 1920x1080 everything disappears. Is there a way to make that position for all resolutions?

 

yangText = self.NewGoldChat(None, wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2 + 1450, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 37 + 9 - 950)

This is the code that is changing the position

 

2560x1440 - https://i.gyazo.com/a85c106cb8ab5e5c1c00ae614a069bd9.jpg - Its in the right place

1920x1080 - https://i.gyazo.com/de1ae5955778f3a66758ef3a05fc0b08.jpg - Its gone

 

Thanks for any help! :)

Sorry for bad english, its not my main language ;) 

Edited by LoLPos (see edit history)
Link to post

2 answers to this question

Recommended Posts

  • 1
  • Solution
Posted (edited)

Of course it will be wrong because you still use wndChat's paramteres while it's not related to wndChat anymore.

You want to stick with the upper right corner, so you don't need wndMgr.GetScreenHeight(), you only need wndMgr.GetScreenWidth().

(Using ScreenHight would make it stick to the bottom right corner btw)

 

Try this:

yangText = self.NewGoldChat(None, wndMgr.GetScreenWidth() - 50, 125)

This code make it stick -50 pixel in right, and -125 from top.

 

These numbers are not accurate with your wish, i don't have that type of yangChat to test where it will fit 100% with your exception,

so you'll have to test and edit those numbers. I just guessed rough numbers where it will be somewhat good.

Edited by TMP4 (see edit history)
  • Love 1
Link to post
  • 0
4 hours ago, TMP4 said:

Of course it will be wrong because you still use wndChat's paramteres while it's not related to wndChat anymore.

You want to stick with the upper right corner, so you don't need wndMgr.GetScreenHeight(), you only need wndMgr.GetScreenWidth().

(Using ScreenHight would make it stick to the bottom right corner btw)

 

Try this:

yangText = self.NewGoldChat(None, wndMgr.GetScreenWidth() - 50, 125)

This code make it stick -50 pixel in right, and -125 from top.

 

These numbers are not accurate with your wish, i don't have that type of yangChat to test where it will fit 100% with your exception,

so you'll have to test and edit those numbers. I just guessed rough numbers where it will be somewhat good.

 

 

That actually worked! Thank you ????? @TMP4

  • Love 1
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.