So I'm trying to animate an image crosshair so it flashes visible when I do damage and disappears after a little bit. I was able to make it work using this code:
Animate Redex xpos "c-10" Linear 0.0 0.1
Animate Redex xpos "9999" Linear 0.2 0.300001
Only problem is that my method is essentially moving it across the screen and so sometimes I literally see the crosshair flash in several different parts of my screen which is a little less than ideal. This happens especially for weapons that do lots of damage ticks over small intervals like needles, the flamethrower, the minigun etc. Anyone have any idea if there's a workaround? I was thinking maybe:
I could accomplish my goal by moving the crosshair instantly by using 'pulse' or 'flicker' instead of linear, no experience using either of those in animations, I've only ever used linear or accel/deaccel.
There was another way to toggle visibility that I missed? I tried using 'alpha' but it didn't work, perhaps I made a simple error however.
I have limited experience with hudanimations_tf.txt, anyone have any information or even a link that would help me? (already checked doodle and flame's hud guides + tf2 wiki + poked around valve developer wiki).
EDIT: I've also already tried resizing it instead of moving it and while that was a reasonable workaround it still didn't seem to happen instantly so I wasn't a huge fan and the same problem remained just it maifested itself differently.
EDIT2: Since image crosshairs use custom textures defined in materials/vgui/replay/thumbnails could I use this?
SetTexture <panel name> <textureidname> <texturefilename> <set time>