Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-22-2013, 04:20 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
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?!
Reply With Quote
  #2  
Old 08-22-2013, 04:25 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
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
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Change the dimensions of GraalControl.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 08-22-2013, 04:35 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Quote:
Originally Posted by xXziroXx View Post
Change the dimensions of GraalControl.
How do you do that?
Reply With Quote
  #4  
Old 08-22-2013, 04:59 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by i8bit View Post
How do you do that?
GraalControl.position = { x, y};
GraalControl.extent = { w, h};
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 08-22-2013, 05:39 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Quote:
Originally Posted by Angel_Light View Post
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;

Reply With Quote
  #6  
Old 08-22-2013, 07:01 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
you can use screenwidth and screenheight
__________________
Deep into the Darkness peering...
Reply With Quote
  #7  
Old 08-22-2013, 07:42 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
PHP Code:
 GraalControl.position = {screenwidth/2-100screenheight/2-100};
 
GraalControl.extent = {200200}; 
Why won't this work for centering?
Reply With Quote
  #8  
Old 08-22-2013, 09:51 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
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
Attached Files
File Type: txt View Window.txt (1.3 KB, 153 views)
File Type: txt View Window - Circle.txt (919 Bytes, 144 views)
__________________
Deep into the Darkness peering...

Last edited by Angel_Light; 08-22-2013 at 11:34 PM..
Reply With Quote
  #9  
Old 08-23-2013, 02:36 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
Quote:
Originally Posted by Angel_Light View Post
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.
__________________
Reply With Quote
  #10  
Old 08-23-2013, 03:03 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by cbk1994 View Post
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) :/
Attached Files
File Type: txt simplified.txt (427 Bytes, 138 views)
__________________
Deep into the Darkness peering...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:23 PM.


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