Need help fading in a sprite

#1
Hey there,

I'm trying to make a sprite slowly fade in onto the player's screen. Like the gasmask overlay, but with another one, and it comes in slowly. I have a timer that I can hook it into, but despite doing this, it comes up as the normal sprite no matter what I do.

Code: Select all

	InfectTexture = LoadTexture("GFX\InfectOverlay.jpg", 1)
	InfectOverlay = CreateSprite(Camera)
	ScaleSprite(InfectOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
	EntityTexture(InfectOverlay, InfectTexture)
	EntityBlend (InfectOverlay, 2)
	EntityFX(InfectOverlay, 1)
	EntityOrder InfectOverlay, -1003
	MoveEntity(InfectOverlay, 0, 0, 1.0)
	EntityAlpha(InfectOverlay, Bloodloss2/100)
	HideEntity(InfectOverlay)
I've divided my timer by 100 so it'll be between 0 and 1 (yeah I hijacked the bloodloss timer ^.^)

My timer:

Code: Select all

Bloodloss2 = Min(Bloodloss2 + (Min(1,3.5)/300.0)*FPSfactor,125)
Anyone have any tips or point out my errors?

Thanks.
SCP - Box of Horrors v0.8.0b
Twitter
Github Profile