Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   screen size (https://forums.graalonline.com/forums/showthread.php?t=16473)

nyghtGT 11-09-2001 09:29 AM

screen size
 
can someone show me how to check the players screen size so my NPC's can adjust if it is changed ...

BocoC 11-09-2001 12:27 PM

The built-in variables "screenwidth" and "screenheight" hold the value's of the width and height of the screen.

nyghtGT 11-09-2001 12:33 PM

therefore:
if(screenwidth=#) {
showimg 501, .....;
}
would work?

BocoC 11-09-2001 12:36 PM

Yes........ But I wouldn't show an image if the screen equaled a certain size. If people play in Windowed mode, the size can really be anything......

nyghtGT 11-09-2001 12:36 PM

Quote:

Originally posted by BocoC
Yes........ But I wouldn't show an image if the screen equaled a certain size. If people play in Windowed mode, the size can really be anything......
ok and thanx ....

BocoC 11-09-2001 12:42 PM

Welcome ^_^ People normally use screenwidth and screenheight to place custom status bars on screen. Like:
NPC Code:

if (timeout) {
showimg 1000,myhpbar.gif,screenwidth*0.85,screenheight*0.1 ;
changeimgpart 1000,0,0,int(playerhearts/playerfullhearts),10;
timeout=0.05;
}


KJS 11-09-2001 12:47 PM

Quote:

Originally posted by BocoC
Welcome ^_^ People normally use screenwidth and screenheight to place custom status bars on screen. Like:
NPC Code:

if (timeout) {
showimg 1000,myhpbar.gif,screenwidth*0.85,screenheight*0.1 ;
changeimgpart 1000,0,0,int(playerhearts/playerfullhearts),10;
timeout=0.05;
}


it would look better like this

NPC Code:

if (timeout) {
showimg 1000,myhpbar.gif,screenwidth-150,50;
changeimgpart 1000,0,0,int(playerhearts/playerfullhearts),10;
timeout=0.05;
}



so then it is always constant on were it is on the screen (so it doesn't get moved if you get what I mean)

nyghtGT 11-09-2001 01:07 PM

thnx you both !
and status bars are what they were for ...

KJS 11-09-2001 02:52 PM

Quote:

Originally posted by nyghtGT
thnx you both !
and status bars are what they were for ...

mainly...

well also things like menus and stuff can use it...

if you want to base something off the center of the screen or like move when you move the screen size then its good to use that...


All times are GMT +2. The time now is 04:12 AM.

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