Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUI scaling (https://forums.graalonline.com/forums/showthread.php?t=134257458)

xXziroXx 12-25-2009 07:01 PM

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? :\

WhiteDragon 12-25-2009 07:21 PM

Could this help? http://wiki.graal.net/index.php/Crea...GuiStretchCtrl

xXziroXx 12-25-2009 07:40 PM

Quote:

Originally Posted by WhiteDragon (Post 1547118)

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 ****.

WhiteDragon 12-25-2009 07:47 PM

Quote:

Originally Posted by xXziroXx (Post 1547121)
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.

xXziroXx 12-25-2009 08:01 PM

Quote:

Originally Posted by WhiteDragon (Post 1547123)
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.

Crow 12-25-2009 08:13 PM

Quote:

Originally Posted by xXziroXx (Post 1547124)
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.

WhiteDragon 12-25-2009 08:21 PM

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.

xXziroXx 12-25-2009 08:31 PM

Quote:

Originally Posted by Crow (Post 1547126)
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.

Crow 12-25-2009 08:48 PM

Quote:

Originally Posted by xXziroXx (Post 1547132)
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.

DustyPorViva 12-25-2009 08:58 PM

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.

xXziroXx 12-25-2009 09:14 PM

Quote:

Originally Posted by Crow (Post 1547136)
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 (Post 1547136)
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.

Crow 12-25-2009 09:31 PM

Quote:

Originally Posted by xXziroXx (Post 1547145)
Which is the whole point of this thread, we need support for that.

You are only talking about scaling the interface elements, no?

xXziroXx 12-25-2009 10:44 PM

Quote:

Originally Posted by Crow (Post 1547148)
You are only talking about scaling the interface elements, no?

Yes, according to a predefined size on the interface.

coreys 12-26-2009 08:55 AM

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.

cbk1994 12-26-2009 10:01 AM

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

DustyPorViva 12-26-2009 10:09 AM

Isn't that exactly what GuiStretchCtrl is doing, though? It scales all children controls with it, as well.

LoneAngelIbesu 12-26-2009 07:46 PM

Quote:

Originally Posted by cbk1994 (Post 1547244)
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'?

cbk1994 12-26-2009 11:05 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1547298)
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.

LoneAngelIbesu 12-26-2009 11:19 PM

Quote:

Originally Posted by cbk1994 (Post 1547320)
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.

WhiteDragon 12-26-2009 11:35 PM

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).

coreys 12-27-2009 04:58 AM

Quote:

Originally Posted by WhiteDragon (Post 1547329)
were set as percents, then they would dynamically change as the screen dimensions change.

^ This

This is how many GUI Toolkits work.


All times are GMT +2. The time now is 05:28 AM.

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