Hi, Im working on a 8-bit 2D platformer and i want to make a glowing line on the edge of the screen (left side and right side) when it requires touch input.
I have the following code but i dont know if i should use a linerenderer, particle system, sprite animation, or if there are any other options.
if(Input.mousePosition.x < Screen.width/2)
{
// Glow left edge of the screen.
}
else if(Input.mousePosition.x > Screen.width/2)
{
// Glow right side of the screen.
}
The attachment is the desired 8bit glow effect. the glow should be from top to bottom of the screen on each side, about a half inch in width. How should i go about doing this?
I don’t understand how it should look like in the end. Could you give a little sketch or describe it more.
Do you want the whole half to be glowed? or just the left/right borders?
Just the left/right borders.
So using the attached image as an example:
For the glow on the left side, it should have squares (pixels), left to right, colored dark green, green, light green, transparent.
I’m sure there’s a more efficient way to accomplish this in code, but if I was going to do it initially I would create one surface on the left edge and one on the right edge - textured as a glow effect and when the desired interaction is presented animate the alpha mask from transparent to opaque.
I’d do the same. Put a sprite on each edge start with alpha 0 and increase the alpha on the appropriate glowing edge sprite depending on how far the mouse is away from the screen’s edge. Maybe even start the increase in alpha before the mouse moves off screen.
Thanks for the suggestions but i think im going to go the Particle way. This way i can make the glow dynamic and animate the glow and have little pixels emitting off the edge. i suck at art so making a sprite like that would be annoying…