Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Screen Sizing (https://forums.graalonline.com/forums/showthread.php?t=134268654)

i8bit 08-22-2013 04:20 PM

Screen Sizing
 
Due to players with larger monitors having an advantage to sparring/PVP and what not, I want to make a controlled screen size where the amount seen in a room is set and and the rest is just black.

At first, I just created 4 black boxes and stretched their width and height as needed. BUT you couldn't see the chat bar, and also it did have it's glitches..

Any ideas?!

xXziroXx 08-22-2013 04:25 PM

Change the dimensions of GraalControl.

i8bit 08-22-2013 04:35 PM

Quote:

Originally Posted by xXziroXx (Post 1721912)
Change the dimensions of GraalControl.

How do you do that?

Angel_Light 08-22-2013 04:59 PM

Quote:

Originally Posted by i8bit (Post 1721914)
How do you do that?

GraalControl.position = { x, y};
GraalControl.extent = { w, h};

i8bit 08-22-2013 05:39 PM

Quote:

Originally Posted by Angel_Light (Post 1721916)
GraalControl.position = { x, y};
GraalControl.extent = { w, h};

Awesome... Thank you.

Now I'm just having an issue with centering it.
I tried to set the x as screenwidth/2-(what ever I set width divided by 2)..
UNTIL I realized the screen width is the width of what you can see..and not the actual window.

So my next question is how do I find out what the size of the actual client's window is?

PHP Code:

//#CLIENTSIDE
function onCreated(){
 
player.chat //Window size width;



Angel_Light 08-22-2013 07:01 PM

you can use screenwidth and screenheight

i8bit 08-22-2013 07:42 PM

PHP Code:

 GraalControl.position = {screenwidth/2-100screenheight/2-100};
 
GraalControl.extent = {200200}; 

Why won't this work for centering?

Angel_Light 08-22-2013 09:51 PM

2 Attachment(s)
After testing it seems screenwidth and screenheight only refer to GraalControl's width / height, I'm not aware of any variable that references window width / height. Once you know that, that method should work.

Here's an example.

e. says "owner has denied your access to the site." if I put the script on here.. o.O I feel loved T-T
Just going to attach it then.

e2. and just for overkill a circle version xP

cbk1994 08-23-2013 02:36 AM

Quote:

Originally Posted by Angel_Light (Post 1721923)
I'm not aware of any variable that references window width / height.

GUIContainer is a parent control to GraalControl and should be the top-level container. It contains GraalControl, the task bar, and some other controls. So, you can just use GUIContainer.width/height when you must know the full window width/height.

Angel_Light 08-23-2013 03:03 AM

1 Attachment(s)
Quote:

Originally Posted by cbk1994 (Post 1721928)
GUIContainer is a parent control to GraalControl and should be the top-level container. It contains GraalControl, the task bar, and some other controls. So, you can just use GUIContainer.width/height when you must know the full window width/height.

Ah, no wonder it was returning NULL for me, I type GuiContainer, not GUIContainer.

Attached a simplified version..
(Still giving me that issue, so can't do php tags) :/


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

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