I want to create animation effect on text while the text is being shown on a video surface. For example- I want to display a text "Skia" on a video surface. First "S" should gradually appear, then "K" and then "I" and "A". Please note, by appear I do not mean translational/rotational motion of text characters. Rather characters should become completely transparent to completely opaque one after another in the foreground, while the video is being played in the background. I believe this will need a custom shader, where we can modify the alpha values of text pixels to be drawn as a function of its position and change it over time. If we feed this shader to SkPaint object and use that paint object in canvas->drawString() function it should work. But I am stuck with a basic problem. While creating the shader, which 2D image should I sample? I cannot sample the entire canvas content since that will apply the shader on the background video as well. How can I ensure that the shader is applied only on the text pixels?
Pardon my inadequate knowledge of shaders. If you think this is not a correct way to approach this problem, feel free to suggest me other ways too.
Thanks & regards,