Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   img layers (https://forums.graalonline.com/forums/showthread.php?t=41054)

billybob53 12-08-2002 08:18 PM

img layers
 
Just wondering.... How do you make one image show over another?

I am making a custom Status bar and the Status image shows over the HP so u can't see it.

How do i change the layering? please help.

Ningnong 12-08-2002 08:46 PM

doh
 
This has been posted before, but just to benefit you:

if you are using showimg's, then a showimg with an index of 201 will show over an index of 200.

Also, you can change the image layer.

changeimgvis index,layer;

eg

//#CLIENTSIDE
if (playerenters || timeout){
showimg 200,your_hp_bar.gif,100,100;
changeimgvis 200,4;
timeout = .05;
}

note: 4 draws on the players screen.
1 = same layer as player.
2 = layer over player
4 = on stats bar. co - ordinates change to screen co ordinates.

therefore, u can use this:

//#CLIENTSIDE
if (playerenters || timeout){
showimg 200,your_hp_bar.gif,screenwidth/2,screenheight/2;
changeimgvis 200,4;
timeout = .05;
}


* was an example *


P.S if you have multiple 'showimg'' and want all of them to have a layer of 4, i suggest using a for loop (saves work)

instead of

changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
changeimgvis 203,4;

use:

for (i=0;i<=203;i++) changeimgvis i,4;

-Ningnong

billybob53 12-08-2002 09:16 PM

oh.... ok, but now theres another problem...

NPC Code:
changeimgpart 402,0,0,int(playermp),25;
showimg 402,mptest.gif,screenwidth-550,screenheight-400;



The problem with that is it doesn't get lower in terms with the player's MP.

(note: the full image X is 200)

Please help..

Ningnong 12-09-2002 12:13 AM

I think you are using something like

if (playerenters){
do all this stuff;
}

well that only occurs once, you need to have a timeout loop to keep checking the players mp

example:

//#CLIENTSIDE
if (playerenters || timeout){
changeimgpart 402,0,0,int(playermp),25; //<your script\/
showimg 402,mptest.gif,screenwidth-550,screenheight-400;
timeout = .1;
}

billybob53 12-09-2002 04:20 AM

i used int(playermp) as the x value, and the full img X=200.

But when the playerMP equals 0 it is still visible by like 25%....

Whats the equation for a X=200 img to equal the Player MP?

Com013 12-10-2002 03:31 AM

Re: doh
 
Quote:

Originally posted by Ningnong
if you are using showimg's, then a showimg with an index of 201 will show over an index of 200.
No. It is only sorted by layer, z, y, and x. (In that order).
But you can even use layers above 4 to make sure a certain image is displayed over an other. *still waiting for the possibility to attach images to each other*


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

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