Question: Sprite flash white?

How does one make their sprite flash white? :thinking:
I’ve tried this…

function update(self, dt)
	if self.flash then
		go.set("#sprite", "tint", vmath.vector4(250, 250, 250, 1))
		self.flashTimer = self.flashTimer + dt
		if self.flashTimer >= self.flashTime then
			self.flashTimer = 0
			self.flash = false
			go.set("#sprite", "tint", vmath.vector4(1,1,1,1))
		end
	end
end

Which does work, but the sprite flashes uh…purple? :sweat_smile:

The “tint” property takes values between 0 and 1. You can make the sprite black by using vmath.vector4(0,0,0,1), but there is no out-of-the-box way to make it brighter.

I made this shader a while back which allows you to change the brightness and contrast, which might help:

1 Like