Post: PreCacheShader not working!
03-17-2016, 11:56 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So, All it does is turns black like it was at first?? Any suggestions??

I'm precaching using "precacheShader("em_bg_ani_dmh");"
I place the code in:
    
init()
{
precacheShader("em_bg_ani_dmh");
level thread onplayerconnect();
}


That doesn't seem to work because I'm trying to use this as a backgound for my mod menu! Also I'm using Sharks menu base < I put overflow fix in and that still didn't fix this problem.
Heres the stuff I put in shader:
    
StoreShaders()
{
self.menu.background = self drawShader("em_bg_ani_dmh", 320, -50, 300, 500, (255, 255, 255), 0, 0);
self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1);
self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);
}
Last edited by Elitexboxer ; 03-18-2016 at 12:22 AM. Reason: Explaining what it is doing incorrectly which I'm not sure what I'm doing wrong?
03-19-2016, 04:01 PM #38
Originally posted by Elitexboxer View Post
Honestly I'm not....

it works for me lel



You must login or register to view this content.
03-19-2016, 04:15 PM #39
Originally posted by silver View Post
it works for me lel



You must login or register to view this content.


I'm offline and don't got the clling card set....
03-20-2016, 01:06 AM #40
Originally posted by Elitexboxer View Post
Actually (0,0,0) is black and (1,1,1) is white or (255,255,255) is white. All I need is a transparent color.


my bad i forget, and no such thing as transperant color bro only .alpha, the drawshader function itself has "SetColor" in it so it will always have a color applied to it. if you need to make your own that doesnt use "SetColor"
i put a example bellow, but thats not issue cause if you set the color to (1, 1, 1) it should show the image anyways, i use playercards in a menu im making and they are set with this color and work.

(btw i made a mistake before you need it to be (1, 1, 1) not (0, 0, 0) as i said earlier sorry )
    Original:

drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
{
if (!isDefined(allclients))
allclients = false;

if (!allclients)
hud = newClientHudElem(self);
else
hud = newHudElem();
hud.elemtype = "icon";
hud.color = color;
hud.alpha = alpha;
hud.sort = sort;
hud.children = [];
hud setParent(level.uiParent);
hud setShader(shader, width, height);
hud.x = x;
hud.y = y;

return hud;
}


    Modified:

drawImage(shader, x, y, width, height, alpha, sort, allclients)
{
if (!isDefined(allclients))
allclients = false;

if (!allclients)
hud = newClientHudElem(self);
else
hud = newHudElem();
hud.elemtype = "icon";
hud.alpha = alpha;
hud.sort = sort;
hud.children = [];
hud setParent(level.uiParent);
hud setShader(shader, width, height);
hud.x = x;
hud.y = y;
level.shaderresult ++;

return hud;
}


you can set your playercard shader as the minimap like so:

put this in your open menu function:

    maps\mp\_compass::setupminimap( "emblem_bg_graf" );


put this in your close menu function:

    maps\mp\_compass::setupminimap( "compass_map_" + getDvar("mapname"));


credits: xturntuplobbies
Last edited by OfficialCoolJay ; 03-20-2016 at 01:20 AM.

The following user thanked OfficialCoolJay for this useful post:

Elitexboxer
04-07-2016, 02:48 PM #41
Originally posted by Elitexboxer View Post
Trying to find the shader with the animated checkered flag?


i belive that one of these

em_bg_ani_dmh
em_bg_ani_anarchy
04-07-2016, 10:11 PM #42
Originally posted by TahhModz View Post
i belive that one of these

em_bg_ani_dmh
em_bg_ani_anarchy


I found them and found out why they weren't working in my menu.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo