Bind it to the event when you want the animation to play. It should be added to the Image or Screen Image object. Scripting Animation Playbackįor more complex animation control beyond Always Play you'll have to write a script.Īn example script for animation playback is shown below. This imported animation can now be used in the Texture field of a newly created Screen Image. Adding a new Screen Image is detailed in the Image guide. One common use case will be using the animated texture on an Image or Screen Image object. Now your 2D animation can be used the same way as other 2D static images in Lens Studio. For example, Always Play and Reverse will play your animation backwards indefinitely. Ping pong alternates between playing the animation forward and backward. If you want it to only play at certain times, you can write a customized script. You can find more info below. For simple animation playback, enable this. Always PlayĪlways Play sets the animation to repeat indefinitely. You can preview the animation in the Inspector panel by clicking the Play button. In the Inspector panel you will see the animation settings for your animation resource. Select the newly imported animation resource. OKĬlicking OK will automatically create a new animation resource derived from the image sequence in the Resources panel. Lower quality means more compression and a smaller file size. The quality of the file (0 - 100) controls the strength of compression. Sprite Sheets should be saved in JPEG format unless they contain transparency, For optimization purposes, only export as PNG if your images contain transparency. If Autodetect is enabled, Lens Studio will automatically find an optimal region to use. This is useful for cutting off empty space around the edges of sprites. This specifies the region of each frame that will be used in the animation. If instead Remove is selected and 4 is entered, every fourth frame will be removed from the animation. Generally, this will be left at the default Keep every 1 frame, but it can be used to uniformly decrease the number of frames used in the animation.įor example, if Keep is selected and 5 is entered, every fifth frame will be used in the animation. This configures the maximum resolution of each sprite sheet that will be generated for the animation.Ī single texture size should never be greater than 2048 x 2048 pixels. If you have 100 frames and you use 2 as the Files count, each sprite sheet texture will have 50 frames.Ī lower number will give better performance, but will display the frames at a lower resolution because each sprite sheet texture is capped at a maximum size.
Files countįiles count configures the number of sprite sheets your animation frames will be distributed across. The window has a number of parameters described below. Once you select all your images in the image sequence, a new window will pop up that allows you to configure the resulting sprite sheet(s) of your animation.
#2d assets for cartoon making series#
An image sequence is a series of separate image files that make up an animation. Go to the Resources panel and click "+" button -> Texture -> 2D Animation From Files and select the image sequence you want to use for your animation.