Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Need help with Health GUI. (https://forums.graalonline.com/forums/showthread.php?t=134265680)

khortez 02-03-2012 06:57 AM

Need help with Health GUI.
 
I have a main GUI that doesn't have the health bar as apart of the image, so i can try to edit the health separately, well the problem is, if i create a new GUIshowimgCtrl for the health, it overlaps the main GUI it's supposed to be apart of and makes it look weird. Does anyone have any suggestions I can use to help fix this?

edit: if something doesn't make sense, let me know.

fowlplay4 02-03-2012 07:45 AM

Provide your images, the code you're using to draw it, and what it looks like when it's drawn.

khortez 02-03-2012 07:11 PM

2 Attachment(s)
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
temp.disabled 0x10 0x20 0x40 0x80 0x100 0x200;
  
showstats(allstats temp.disabled);
  new 
GuiShowImgCtrl("GUI_Health") {
    
40;
    
30;
    
width 500;
    
height 130;
    
image "cega_guitest-frozenlies0.png";
    
partx 20;
    
party 10;
    
parth 500;
    
partw 300;
  }
  new 
GuiShowImgCtrl("GUI_HealthBar") {
    
5;
    
65;
    
width 204;
    
height 20;
    
image "cega_guitest-frozenlies0.png";
    
partx 20;
    
party 150;
    
parth 500;
    
partw 300;
  }



cbk1994 02-04-2012 02:32 AM

Use the partx/party/partw/parth to modify the dimensions of the subimage you're using. If you made that script you'll understand how to use them. If not check the documentation (if it exists).

khortez 02-04-2012 02:58 AM

there is wiki on it, but it doesn't say much:

http://wiki.graal.net/index.php/Crea...lient/TShowImg

partx: float
party: float
etc..

cbk1994 02-04-2012 03:06 AM

Quote:

Originally Posted by khortez (Post 1683570)
there is wiki on it, but it doesn't say much:

http://wiki.graal.net/index.php/Crea...lient/TShowImg

partx: float
party: float
etc..

The names are pretty self-descriptive. The coordinates of the subimage (x/y/width/height).

fowlplay4 02-04-2012 03:11 AM

Quote:

Originally Posted by cbk1994 (Post 1683571)
The names are pretty self-descriptive. The coordinates of the subimage (x/y/width/height).

It was also just explained in your other thread:
http://forums.graalonline.com/forums...hp?t=134265659

You need to isolate the bar image, and display it over the main GUI.

After you've isolated the bar image, adjust the x and y of the bar GUI until it's in the right position.

Then you can modify the partw depending on your health's ratio. I.e: partw =(hp / hpmax) * bar_width;

khortez 02-04-2012 03:11 AM

In some ways they are, just wish they had a bit more to them is all. but that's just me. ;p


edit: oh and if i read his post correctly, it was what SSSSSS wanted, but in reverse, i wanted one GUI on top of the other. otherwise it looked funny because the health bar would be on top of the other GUI parts even with the partx, party, edit.

Although guys i do thank you anyway ;p i figured out what i needed to do, and you guys answered other questions i had that i was gonna ask later anyway, thanks again :D


All times are GMT +2. The time now is 01:14 AM.

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