ID:154993
![]() Oct 17 2011, 2:19 pm
|
|
How can I make a window in the Skin come otu in the center of my main Window?
|
![]() Oct 17 2011, 2:21 pm
|
|
Hmm, last time I checked, just move the window in the grid to where you want it to initially pop up...
|
Megablaze wrote:
Use "pos=[X_pos],[Y_pos]" in winset. The only problem with that is for people with different ressolutions. |
No, ignore the resolution thing Lucifer said. Using winget you'll get a text variable of the position, using both findtext() and copytext() you can pull the Xpos and the Ypos in seperate variables. Then you convert it into a number using text2num(). You add a number to the Xpos and Ypos, you can find out the exact center with math, or just guess till it's around the spot you want. Then use winset to set your new window pos the way i wrote it before. I'm not going to write out the code for it, you can figure it out yourself, or if someone wants to write it out for you they can do so.
|
I appreciate the help. Many times no one helps people on the forums. Or only posts once. So I very much appreciate your multiable responses.
|
This helped me a lot before:
http://www.byond.com/developer/forum/?id=637580 |
Thanks, A. Ness! This will svae me some time and trouble. Would have been to try and make it on my own but this will svae me some time for sure. I appreciate it.
If there is a more effecient way using Javascript I can;t imagine a way to do it. |
Shadowkaroth wrote:
Thanks, A. Ness! This will svae me some time and trouble. Would have been to try and make it on my own but this will svae me some time for sure. I appreciate it. Well, here's what I use: var { |
Not sure if it's more efficient, but there was issues with delays/ignoring javascript before, so I didn't suggest it.
|
Megablaze wrote:
Uh, no, he can just use winget to find the pos of the main window, and center it based on that. Then say that, not just use positions. Hes most likely new to anything along the terms of positioning if hes asking for help. You need to learn to be a bit more specific when explaining something. |