Alright, I have created a spritesheet with two frames called cord.png
, which has a resolution of 62x12. Each frame is 31x12. I added the following code to my _ready()
method in the hopes that it would set the Line2D's
texture as the first frame of the spritesheet.
# load atlas texture
atlas_texture = AtlasTexture.new()
atlas_texture.atlas = load("img/cord.png")
atlas_texture.region = Rect2(Vector2(0,0), Vector2(31,12))
get_node("Line2D").texture = atlas_texture
But the Line2D
still seems to use the entire spritesheet as its texture, rather than the subregion of it.
Any thoughts about what I'm doing wrong?