Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUIs/HUDs (https://forums.graalonline.com/forums/showthread.php?t=65001)

Bl0nkt 03-27-2006 11:36 PM

GUIs/HUDs
 
I'm trying to take an image and place it on a part of the player's screen (GUIs/HUDs). I've tried various formulas with screenx, screeny, worldx, worldy, etc and I can't figure it out.

Just requesting a little help.

Edit: Take note that it should stay there while moving.

Maniaman 03-27-2006 11:51 PM

changeimgvis id,4

Bl0nkt 03-27-2006 11:55 PM

and it was that simple all along...

You have no idea about the ridiculous formulas I created.


Edit:

I'm trying to show it at the bottom left of the screen. I can get it down there with screenheight/1.05, but it's only visible in fullscreen.

Warcaptain 03-28-2006 12:17 AM

You should use screenwidth-WIDTHOFIMAGE screenheight-HEIGHTOFIMAGE

ie a 32x32 image (to put in very bottom right corner) would be
screenwidth-32,screenheight-32

also, to make sure that it always stays there you should (if this is on GS2 which I assume it is) check if the GraalControl is resized.

can do that by simple Gui functions.. ie: function GraalControl.onResize() and reposition the image using with(findimg(INDEX)) and changing the x y

Bl0nkt 03-28-2006 01:12 AM

Ahh, I see. Simple enough.

How would you do that in GS1? I am using GS2, but I'm just curious.

Warcaptain 03-28-2006 01:24 AM

in GS1 graalcontrol cant be resized (as far as I know) so the only real way to make sure its always in the same spot is to put it on timeout loop and check if the screenwidth/height has changed and if it has show the image again at the right x,y

Bl0nkt 03-28-2006 01:26 AM

Always the laggy way out with GS1, huh.

Warcaptain 03-28-2006 01:28 AM

Yes, unfortunately.

It cuts down a lot if you do the checking if screenwidth/height has changed instead of constantly doing showimg.. but still the annoying timeout loop.

I try to avoid timeout loops if at all possible on Mana Realms to cut down on CPU Time.


All times are GMT +2. The time now is 06:16 AM.

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