Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-25-2009, 07:01 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
GUI scaling

Is it possible to actually scale a GUI control to always have a certain size on the players screen no matter his/her resolution? If not, why not Stefan?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #2  
Old 12-25-2009, 07:21 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Could this help? http://wiki.graal.net/index.php/Crea...GuiStretchCtrl
Reply With Quote
  #3  
Old 12-25-2009, 07:40 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
Last time I tried it, it turned out looking extremely ugly. Pretty sad if that's the only way, because it ends up looking like ****.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 12-25-2009, 07:47 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by xXziroXx View Post
Last time I tried it, it turned out looking extremely ugly. Pretty sad if that's the only way, because it ends up looking like ****.
Yeah. The only other way to do it factor screenwidth and screenheight into all your calculations and just make everything a percentage.

I suppose it would be possible to make a function that generates the proper width and height (from say widthp and heightp) when you pass a GUI object, and also sets handlers for when the screenheight/screenwidth is changed.
Reply With Quote
  #5  
Old 12-25-2009, 08:01 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
Yeah. The only other way to do it factor screenwidth and screenheight into all your calculations and just make everything a percentage.

I suppose it would be possible to make a function that generates the proper width and height (from say widthp and heightp) when you pass a GUI object, and also sets handlers for when the screenheight/screenwidth is changed.
That'd be a general pain-in-the-you-know-what though. I just wish Stefan could add proper GUI scaling like pretty much any other game have.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 12-25-2009, 08:13 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
That'd be a general pain-in-the-you-know-what though. I just wish Stefan could add proper GUI scaling like pretty much any other game have.
Don't think it'd work well with Graal, due to basically all screen resolutions being possible.
Reply With Quote
  #7  
Old 12-25-2009, 08:21 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Well, actually scaling the graphics, for say different DPI, would be a different problem, because that would require scalable vector graphics (which would be a whole other path to travel down); but, resizing the controls for different screen sizes would not be difficult and potentially useful.
Reply With Quote
  #8  
Old 12-25-2009, 08:31 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Crow View Post
Don't think it'd work well with Graal, due to basically all screen resolutions being possible.
You can do that in pretty much all games that includes GUI scaling as well, you know, as long as they have a "Windowed Mode" option.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 12-25-2009, 08:48 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
You can do that in pretty much all games that includes GUI scaling as well, you know, as long as they have a "Windowed Mode" option.
I rarely encounter games that support this behavior. And the game content will scale/stretch according to the resolution, while in Graal, it doesn't do that.
Reply With Quote
  #10  
Old 12-25-2009, 08:58 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Problem with GUIstretch is that it uses bilinear scaling, which generally looks pretty damn bad with transparency. It would be nice if it was nearest-neighbor instead.
Reply With Quote
  #11  
Old 12-25-2009, 09:14 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Crow View Post
I rarely encounter games that support this behavior.
WoW, for one, supports it. Could name a few others on the top of my head, but it doesn't matter since there are *A LOT* of games that supports it.

Quote:
Originally Posted by Crow View Post
And the game content will scale/stretch according to the resolution, while in Graal, it doesn't do that.
Which is the whole point of this thread, we need support for that.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 12-25-2009, 09:31 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
Which is the whole point of this thread, we need support for that.
You are only talking about scaling the interface elements, no?
Reply With Quote
  #13  
Old 12-25-2009, 10:44 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Crow View Post
You are only talking about scaling the interface elements, no?
Yes, according to a predefined size on the interface.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 12-26-2009, 08:55 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Something like this would be cool:
PHP Code:
new GuiControl(TestControl)
{
  
scale true// something like this, to show it should be proportional to the screen size
  
.4// equivalent to screenwidth*.4
  
.5// equivalent to screenheight*.5
  
width .5// half the width of the screen
  
height .2// 1/4th the height of the screen

Edit: If it was actually proportional to the parent control, that would be best.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #15  
Old 12-26-2009, 10:01 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
This would be an awesome addition, though I'd rather seeing it work something like

PHP Code:
new GuiControl(TestControl)
{
  
40[percent]; // equivalent to screenwidth*.4
  
50[percent]; // equivalent to screenheight*.5
  
width 50[percent]; // half the width of the screen
  
height 25[percent]; // 1/4th the height of the screen

This forum percent sign crap really needs to be fixed z.z
__________________
Reply With Quote
  #16  
Old 12-26-2009, 10:09 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Isn't that exactly what GuiStretchCtrl is doing, though? It scales all children controls with it, as well.
Reply With Quote
  #17  
Old 12-26-2009, 07:46 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by cbk1994 View Post
This would be an awesome addition, though I'd rather seeing it work something like

PHP Code:
new GuiControl(TestControl)
{
  
40[percent]; // equivalent to screenwidth*.4
  
50[percent]; // equivalent to screenheight*.5
  
width 50[percent]; // half the width of the screen
  
height 25[percent]; // 1/4th the height of the screen

This forum percent sign crap really needs to be fixed z.z
What's the problem with doing this?
PHP Code:
new GuiControl(TestControl)
{
  
screenwidth*.4;
  
screenheight/2;
  
width screenwidth/2;
  
height screenheight/4;

Seems like you're simply providing a different syntax for something that's already possible and not at all hard to do. Am I not understanding what's meant by 'scaling'?
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #18  
Old 12-26-2009, 11:05 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by LoneAngelIbesu View Post
What's the problem with doing this?
PHP Code:
new GuiControl(TestControl)
{
  
screenwidth*.4;
  
screenheight/2;
  
width screenwidth/2;
  
height screenheight/4;

Seems like you're simply providing a different syntax for something that's already possible and not at all hard to do. Am I not understanding what's meant by 'scaling'?
The idea is that it's based on the parent control. Sure, it's possible right now, but it requires a lot more work than it should.
__________________
Reply With Quote
  #19  
Old 12-26-2009, 11:19 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by cbk1994 View Post
The idea is that it's based on the parent control. Sure, it's possible right now, but it requires a lot more work than it should.
I guess "a lot" is subjective. Then again, I always use these 'scaling' techniques, so typing an object name is normal for me. I mean, it's just the difference between amount of characters typed.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #20  
Old 12-26-2009, 11:35 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
The major difference would be that defining the dimensions using screenheight/screenwidth would result in them being set statically, once.

If they were set as percents, then they would dynamically change as the screen dimensions change.


The only way to do this currently would be hooks and something to manage all your GUI controls (which I suggested in the 4th post of this thread).
Reply With Quote
  #21  
Old 12-27-2009, 04:58 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by WhiteDragon View Post
were set as percents, then they would dynamically change as the screen dimensions change.
^ This

This is how many GUI Toolkits work.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.