Skip to content

Commit b5a7934

Browse files
committed
Update create_atlas.script
1 parent ec319d5 commit b5a7934

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/resource/create_atlas/create_atlas.script

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@ function init(self)
100100
local my_texture_id = create_texture(width, height)
101101
local my_atlas_id = create_atlas(my_texture_id, width, height)
102102

103+
-- set the new atlas on the sprite and show one image
103104
go.set("#sprite", "image", my_atlas_id)
104105
sprite.play_flipbook("#sprite", "my_animation_left")
105106

107+
-- set the new atlas on the gui component and use on a node from the gui script
106108
go.set("gui#gui", "textures", my_atlas_id, { key = "my_atlas" })
107109
msg.post("gui#gui", "use_atlas", { texture = "my_atlas", animation = "my_animation_right" })
108110
end

0 commit comments

Comments
 (0)