Jump to content
  • 0

solved Changing position of UI elements with different resolutions


LoLPos
Go to solution Solved by TMP4,

Question

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
Link to post

2 answers to this question

Recommended Posts

  • 1
  • Solution

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
  • 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
Guest
This topic is now closed to further replies.


Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

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