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...
|
In response to Speedro
|
|
I want a Window to pop up in in the main window. Not a control in to a window.
|
In response to Shadowkaroth
|
|
Use "pos=[X_pos],[Y_pos]" in winset.
|
In response to Megablaze
|
|
Megablaze wrote:
Use "pos=[X_pos],[Y_pos]" in winset. The only problem with that is for people with different ressolutions. |
In response to XxLucifersJesterxX
|
|
Uh, no, he can just use winget to find the pos of the main window, and center it based on that.
|
In response to Megablaze
|
|
Intresting thank you. I could pull each ressolution and just round out the center from it. Correct?
|
In response to Shadowkaroth
|
|
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.
|
In response to Megablaze
|
|
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 |
In response to Megablaze
|
|
Wouldn't a JavaScript return be more efficient? I'm actually not sure, I'm just wondering.
|
In response to A. Ness
|
|
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. |
In response to Shadowkaroth
|
|
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 { |
In response to CauTi0N
|
|
Not sure if it's more efficient, but there was issues with delays/ignoring javascript before, so I didn't suggest it.
|
In response to Megablaze
|
|
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. |
In response to D-Cire
|
|
Well I can't seem to figure out how to pull the size properly when the main window is maxed?
|