I am currently creating a game where I want my player to shoot a laser, which I implemented as a Line2D
.
I am using a sprite that repeats (as a tile):

I can accomplish this quite simply by importing the texture as 'Repeating' and then giving the Line2D
an ImageTexture
What I would like to do, however, is change the sprite every frame, by 'looping' the sprite 1 pixel, to make it seem like the laser is flowing. What I mean is that on frame 1 I have the following sprite:

While on frame 2 I have:

It's probably hard to see, but the second image has the righternmost column of image 1 removed and added as its first column. This process then repeats 64 times (as my laser tile is 64 pixels wide)
I have tried giving the Line2D
an AtlasTexture
, then give that an ImageTexture
. This ImageTexture
contains all the frames I want to use as a spritesheet. Then, in code, I try and update the Region
property of the AtlasTexture
. However, it seems Line2D
doesn't allow this behavior, as the sprite doesn't change.
Any ideas on how to approach this?