[{"data":1,"prerenderedAt":1565},["ShallowReactive",2],{"navigation":3,"/api/objects/animated-sprite":498,"/api/objects/animated-sprite-surround":1560},[4,26],{"title":5,"path":6,"stem":7,"children":8},"Getting Started","/getting-started","1.getting-started/1.index",[9,10,14,18,22],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"Installation Guide","/getting-started/installation","1.getting-started/2.installation",{"title":15,"path":16,"stem":17},"Usage","/getting-started/usage","1.getting-started/3.usage",{"title":19,"path":20,"stem":21},"Loading Models","/getting-started/loading-models","1.getting-started/4.loading-models",{"title":23,"path":24,"stem":25},"Upgrade Guide","/getting-started/upgrade-guide","1.getting-started/5.upgrade-guide",{"title":27,"path":28,"stem":29,"children":30},"Api","/api","2.api",[31,34,96,126,168,210,308,334,368,418,464],{"title":32,"path":28,"stem":33},"All","2.api/index",{"title":35,"path":36,"stem":37,"children":38},"Abstractions","/api/abstractions","2.api/1.abstractions/index",[39,40,44,48,52,56,60,64,68,72,76,80,84,88,92],{"title":35,"path":36,"stem":37},{"title":41,"path":42,"stem":43},"Align","/api/abstractions/align","2.api/1.abstractions/align",{"title":45,"path":46,"stem":47},"Billboard","/api/abstractions/billboard","2.api/1.abstractions/billboard",{"title":49,"path":50,"stem":51},"Camera Shake","/api/abstractions/camera-shake","2.api/1.abstractions/camera-shake",{"title":53,"path":54,"stem":55},"Decal","/api/abstractions/decal","2.api/1.abstractions/decal",{"title":57,"path":58,"stem":59},"Edges","/api/abstractions/edges","2.api/1.abstractions/edges",{"title":61,"path":62,"stem":63},"Fit","/api/abstractions/fit","2.api/1.abstractions/fit",{"title":65,"path":66,"stem":67},"Instances","/api/abstractions/instances","2.api/1.abstractions/instances",{"title":69,"path":70,"stem":71},"Levioso (Float)","/api/abstractions/levioso","2.api/1.abstractions/levioso",{"title":73,"path":74,"stem":75},"Mask","/api/abstractions/mask","2.api/1.abstractions/mask",{"title":77,"path":78,"stem":79},"Merged","/api/abstractions/merged","2.api/1.abstractions/merged",{"title":81,"path":82,"stem":83},"Outline","/api/abstractions/outline","2.api/1.abstractions/outline",{"title":85,"path":86,"stem":87},"Sampler","/api/abstractions/sampler","2.api/1.abstractions/sampler",{"title":89,"path":90,"stem":91},"ScreenSizer","/api/abstractions/screen-sizer","2.api/1.abstractions/screen-sizer",{"title":93,"path":94,"stem":95},"ScreenSpace","/api/abstractions/screen-space","2.api/1.abstractions/screen-space",{"title":97,"path":98,"stem":99,"children":100},"Controls","/api/controls","2.api/2.controls/index",[101,102,106,110,114,118,122],{"title":97,"path":98,"stem":99},{"title":103,"path":104,"stem":105},"Camera Controls","/api/controls/camera-controls","2.api/2.controls/camera-controls",{"title":107,"path":108,"stem":109},"Keyboard Controls","/api/controls/keyboard-controls","2.api/2.controls/keyboard-controls",{"title":111,"path":112,"stem":113},"Map Controls","/api/controls/map-controls","2.api/2.controls/map-controls",{"title":115,"path":116,"stem":117},"Orbit Controls","/api/controls/orbit-controls","2.api/2.controls/orbit-controls",{"title":119,"path":120,"stem":121},"PointerLock Controls","/api/controls/pointer-lock-controls","2.api/2.controls/pointer-lock-controls",{"title":123,"path":124,"stem":125},"Transform Controls","/api/controls/transform-controls","2.api/2.controls/transform-controls",{"title":127,"path":128,"stem":129,"children":130},"Loaders","/api/loaders","2.api/3.loaders/index",[131,132,136,140,144,148,152,156,160,164],{"title":127,"path":128,"stem":129},{"title":133,"path":134,"stem":135},"useGLTF","/api/loaders/use-gltf","2.api/3.loaders/1.use-gltf",{"title":137,"path":138,"stem":139},"GLTFModel","/api/loaders/gltf-model","2.api/3.loaders/2.gltf-model",{"title":141,"path":142,"stem":143},"useFBX","/api/loaders/use-fbx","2.api/3.loaders/3.use-fbx",{"title":145,"path":146,"stem":147},"FBXModel","/api/loaders/fbx-model","2.api/3.loaders/4.fbx-model",{"title":149,"path":150,"stem":151},"useTexture","/api/loaders/use-texture","2.api/3.loaders/5.use-texture",{"title":153,"path":154,"stem":155},"useTextures","/api/loaders/use-textures","2.api/3.loaders/6.use-textures",{"title":157,"path":158,"stem":159},"useSVG","/api/loaders/use-svg","2.api/3.loaders/7.use-svg",{"title":161,"path":162,"stem":163},"useProgress","/api/loaders/use-progress","2.api/3.loaders/use-progress",{"title":165,"path":166,"stem":167},"useVideoTexture","/api/loaders/use-video-texture","2.api/3.loaders/use-video-texture",{"title":169,"path":170,"stem":171,"children":172},"Materials","/api/materials","2.api/4.materials/index",[173,174,178,182,186,190,194,198,202,206],{"title":169,"path":170,"stem":171},{"title":175,"path":176,"stem":177},"Custom Shader Material","/api/materials/custom-shader-material","2.api/4.materials/custom-shader-material",{"title":179,"path":180,"stem":181},"Mesh Glass Material","/api/materials/glass-material","2.api/4.materials/glass-material",{"title":183,"path":184,"stem":185},"Holographic Material","/api/materials/holographic-material","2.api/4.materials/holographic-material",{"title":187,"path":188,"stem":189},"Mesh Discard Material","/api/materials/mesh-discard-material","2.api/4.materials/mesh-discard-material",{"title":191,"path":192,"stem":193},"Mesh Portal Material","/api/materials/mesh-portal-material","2.api/4.materials/mesh-portal-material",{"title":195,"path":196,"stem":197},"Mesh Reflection Material","/api/materials/mesh-reflection-material","2.api/4.materials/mesh-reflection-material",{"title":199,"path":200,"stem":201},"Mesh Transmission Material","/api/materials/mesh-transmission-material","2.api/4.materials/mesh-transmission-material",{"title":203,"path":204,"stem":205},"Point Material","/api/materials/point-material","2.api/4.materials/point-material",{"title":207,"path":208,"stem":209},"Wobble Material","/api/materials/wobble-material","2.api/4.materials/wobble-material",{"title":211,"path":212,"stem":213,"children":214},"Shapes","/api/shapes","2.api/5.shapes/index",[215,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304],{"title":211,"path":212,"stem":213},{"title":217,"path":218,"stem":219},"Box","/api/shapes/box","2.api/5.shapes/box",{"title":221,"path":222,"stem":223},"CatmullRomCurve3","/api/shapes/catmullromcurve3","2.api/5.shapes/catmullromcurve3",{"title":225,"path":226,"stem":227},"Circle","/api/shapes/circle","2.api/5.shapes/circle",{"title":229,"path":230,"stem":231},"Cone","/api/shapes/cone","2.api/5.shapes/cone",{"title":233,"path":234,"stem":235},"Cubic Bezier Line","/api/shapes/cubic-bezier-line","2.api/5.shapes/cubic-bezier-line",{"title":237,"path":238,"stem":239},"Cylinder","/api/shapes/cylinder","2.api/5.shapes/cylinder",{"title":241,"path":242,"stem":243},"Dodecahedron","/api/shapes/dodecahedron","2.api/5.shapes/dodecahedron",{"title":245,"path":246,"stem":247},"Grid","/api/shapes/grid","2.api/5.shapes/grid",{"title":249,"path":250,"stem":251},"Icosahedron","/api/shapes/icosahedron","2.api/5.shapes/icosahedron",{"title":253,"path":254,"stem":255},"Line2","/api/shapes/line2","2.api/5.shapes/line2",{"title":257,"path":258,"stem":259},"Octahedron","/api/shapes/octahedron","2.api/5.shapes/octahedron",{"title":261,"path":262,"stem":263},"Plane","/api/shapes/plane","2.api/5.shapes/plane",{"title":265,"path":266,"stem":267},"Quadratic Bezier Line","/api/shapes/quadratic-bezier-line","2.api/5.shapes/quadratic-bezier-line",{"title":269,"path":270,"stem":271},"Ring","/api/shapes/ring","2.api/5.shapes/ring",{"title":273,"path":274,"stem":275},"Rounded Box","/api/shapes/rounded-box","2.api/5.shapes/rounded-box",{"title":277,"path":278,"stem":279},"Rounded Plane","/api/shapes/rounded-plane","2.api/5.shapes/rounded-plane",{"title":281,"path":282,"stem":283},"Screen Quad","/api/shapes/screen-quad","2.api/5.shapes/screen-quad",{"title":285,"path":286,"stem":287},"Sphere","/api/shapes/sphere","2.api/5.shapes/sphere",{"title":289,"path":290,"stem":291},"Superformula","/api/shapes/superformula","2.api/5.shapes/superformula",{"title":293,"path":294,"stem":295},"Tetrahedron","/api/shapes/tetrahedron","2.api/5.shapes/tetrahedron",{"title":297,"path":298,"stem":299},"Torus","/api/shapes/torus","2.api/5.shapes/torus",{"title":301,"path":302,"stem":303},"Torus Knot","/api/shapes/torus-knot","2.api/5.shapes/torus-knot",{"title":305,"path":306,"stem":307},"Tube","/api/shapes/tube","2.api/5.shapes/tube",{"title":309,"path":310,"stem":311,"children":312},"Debug/Performance","/api/debug-performance","2.api/6.debug-performance/index",[313,314,318,322,326,330],{"title":309,"path":310,"stem":311},{"title":315,"path":316,"stem":317},"Helper","/api/debug-performance/helper","2.api/6.debug-performance/helper",{"title":319,"path":320,"stem":321},"LOD","/api/debug-performance/lod","2.api/6.debug-performance/lod",{"title":323,"path":324,"stem":325},"Stats","/api/debug-performance/stats","2.api/6.debug-performance/stats",{"title":327,"path":328,"stem":329},"StatsGl","/api/debug-performance/stats-gl","2.api/6.debug-performance/stats-gl",{"title":331,"path":332,"stem":333},"useBVH","/api/debug-performance/use-bvh","2.api/6.debug-performance/use-bvh",{"title":335,"path":336,"stem":337,"children":338},"Light/Shadow","/api/light-shadow","2.api/7.light-shadow/index",[339,340,344,348,352,356,360,364],{"title":335,"path":336,"stem":337},{"title":341,"path":342,"stem":343},"Accumulative Shadows","/api/light-shadow/accumulative-shadows","2.api/7.light-shadow/accumulative-shadows",{"title":345,"path":346,"stem":347},"Bake Shadows","/api/light-shadow/bake-shadows","2.api/7.light-shadow/bake-shadows",{"title":349,"path":350,"stem":351},"Circle Shadow","/api/light-shadow/circle-shadow","2.api/7.light-shadow/circle-shadow",{"title":353,"path":354,"stem":355},"Contact Shadows","/api/light-shadow/contact-shadows","2.api/7.light-shadow/contact-shadows",{"title":357,"path":358,"stem":359},"Lensflare","/api/light-shadow/lensflare","2.api/7.light-shadow/lensflare",{"title":361,"path":362,"stem":363},"Randomized Lights","/api/light-shadow/randomized-lights","2.api/7.light-shadow/randomized-lights",{"title":365,"path":366,"stem":367},"Soft Shadows","/api/light-shadow/soft-shadows","2.api/7.light-shadow/soft-shadows",{"title":369,"path":370,"stem":371,"children":372},"Staging","/api/staging","2.api/8.staging/index",[373,374,378,382,386,390,394,398,402,406,410,414],{"title":369,"path":370,"stem":371},{"title":375,"path":376,"stem":377},"Environment","/api/staging/environment","2.api/8.staging/1.environment",{"title":379,"path":380,"stem":381},"useEnvironment","/api/staging/use-environment","2.api/8.staging/2.use-environment",{"title":383,"path":384,"stem":385},"Lightformer","/api/staging/lightformer","2.api/8.staging/3.lightformer",{"title":387,"path":388,"stem":389},"Backdrop","/api/staging/backdrop","2.api/8.staging/backdrop",{"title":391,"path":392,"stem":393},"Ocean","/api/staging/ocean","2.api/8.staging/ocean",{"title":395,"path":396,"stem":397},"Precipitation","/api/staging/precipitation","2.api/8.staging/precipitation",{"title":399,"path":400,"stem":401},"Sky","/api/staging/sky","2.api/8.staging/sky",{"title":403,"path":404,"stem":405},"Smoke","/api/staging/smoke","2.api/8.staging/smoke",{"title":407,"path":408,"stem":409},"Sparkles","/api/staging/sparkles","2.api/8.staging/sparkles",{"title":411,"path":412,"stem":413},"Stage","/api/staging/stage","2.api/8.staging/stage",{"title":415,"path":416,"stem":417},"Stars","/api/staging/stars","2.api/8.staging/stars",{"title":419,"path":420,"stem":421,"children":422},"Objects","/api/objects","2.api/9.objects/index",[423,424,428,432,436,440,444,448,452,456,460],{"title":419,"path":420,"stem":421},{"title":425,"path":426,"stem":427},"AnimatedSprite","/api/objects/animated-sprite","2.api/9.objects/animated-sprite",{"title":429,"path":430,"stem":431},"CubeCamera","/api/objects/cube-camera","2.api/9.objects/cube-camera",{"title":433,"path":434,"stem":435},"Fbo","/api/objects/fbo","2.api/9.objects/fbo",{"title":437,"path":438,"stem":439},"GradientTexture","/api/objects/gradient-texture","2.api/9.objects/gradient-texture",{"title":441,"path":442,"stem":443},"HTML","/api/objects/html","2.api/9.objects/html",{"title":445,"path":446,"stem":447},"Image","/api/objects/image","2.api/9.objects/image",{"title":449,"path":450,"stem":451},"MarchingCubes","/api/objects/marching-cubes","2.api/9.objects/marching-cubes",{"title":453,"path":454,"stem":455},"Reflector","/api/objects/reflector","2.api/9.objects/reflector",{"title":457,"path":458,"stem":459},"Refractor","/api/objects/refractor","2.api/9.objects/refractor",{"title":461,"path":462,"stem":463},"Text3D","/api/objects/text-3d","2.api/9.objects/text-3d",{"title":465,"path":466,"stem":467,"children":468},"Miscellaneous","/api/miscellaneous","2.api/miscellaneous/index",[469,470,474,478,482,486,490,494],{"title":465,"path":466,"stem":467},{"title":471,"path":472,"stem":473},"Bounds","/api/miscellaneous/bounds","2.api/miscellaneous/bounds",{"title":475,"path":476,"stem":477},"GlobalAudio","/api/miscellaneous/global-audio","2.api/miscellaneous/global-audio",{"title":479,"path":480,"stem":481},"MouseParallax","/api/miscellaneous/mouse-parallax","2.api/miscellaneous/mouse-parallax",{"title":483,"path":484,"stem":485},"PositionalAudio","/api/miscellaneous/positional-audio","2.api/miscellaneous/positional-audio",{"title":487,"path":488,"stem":489},"useAnimations","/api/miscellaneous/use-animations","2.api/miscellaneous/use-animations",{"title":491,"path":492,"stem":493},"useGLTFExporter","/api/miscellaneous/use-gltf-exporter","2.api/miscellaneous/use-gltf-exporter",{"title":495,"path":496,"stem":497},"useIntersect","/api/miscellaneous/use-intersect","2.api/miscellaneous/use-intersect",{"id":499,"title":425,"body":500,"description":1554,"extension":1555,"links":1556,"meta":1557,"navigation":628,"path":426,"seo":1558,"stem":427,"__hash__":1559},"docs/2.api/9.objects/animated-sprite.md",{"type":501,"value":502,"toc":1536},"minimark",[503,509,528,538,542,796,808,812,818,832,841,845,852,872,876,884,889,916,920,1271,1275,1345,1348,1355,1359,1362,1367,1370,1382,1398,1402,1405,1442,1445,1457,1461,1470,1480,1488,1491,1522,1525,1532],[504,505,506],"scene-controls-wrapper",{},[507,508],"objects-animated-sprite",{},[510,511,512,516,517,524,525,527],"p",{},[513,514,515],"code",{},"\u003CAnimatedSprite />"," displays 2D animations defined in a ",[518,519,523],"a",{"href":520,"rel":521},"https://en.wikipedia.org/wiki/Texture_atlas",[522],"nofollow","texture atlas",". A typical ",[513,526,515],{}," will use:",[529,530,531,535],"ul",{},[532,533,534],"li",{},"An image containing multiple sprites",[532,536,537],{},"A JSON atlas containing the individual sprite coordinates in the image",[539,540,15],"h2",{"id":541},"usage",[543,544,556],"pre",{"className":545,"code":546,"highlights":547,"language":554,"meta":555,"style":555},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup lang=\"ts\">\nimport { AnimatedSprite } from '@tresjs/cientos'\n\nconst currentAnimation = ref('cientosIdle')\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CTresCanvas>\n    \u003CSuspense>\n      \u003CAnimatedSprite\n        image=\"https://raw.githubusercontent.com/Tresjs/assets/main/textures/animated-sprite/cientosTexture.png\"\n        atlas=\"https://raw.githubusercontent.com/Tresjs/assets/main/textures/animated-sprite/cientosAtlas.json\"\n        :animation=\"currentAnimation\"\n      />\n    \u003C/Suspense>\n  \u003C/TresCanvas>\n\u003C/template>\n",[548,549,550,551,552,553],2,10,11,12,13,14,"vue","",[513,557,558,593,623,630,659,669,674,684,695,706,715,731,746,761,767,777,787],{"__ignoreMap":555},[559,560,563,567,571,575,578,581,584,588,590],"span",{"class":561,"line":562},"line",1,[559,564,566],{"class":565},"sMK4o","\u003C",[559,568,570],{"class":569},"swJcz","script",[559,572,574],{"class":573},"spNyl"," setup",[559,576,577],{"class":573}," lang",[559,579,580],{"class":565},"=",[559,582,583],{"class":565},"\"",[559,585,587],{"class":586},"sfazB","ts",[559,589,583],{"class":565},[559,591,592],{"class":565},">\n",[559,594,597,601,604,608,611,614,617,620],{"class":595,"line":548},[561,596],"highlight",[559,598,600],{"class":599},"s7zQu","import",[559,602,603],{"class":565}," {",[559,605,607],{"class":606},"sTEyZ"," AnimatedSprite",[559,609,610],{"class":565}," }",[559,612,613],{"class":599}," from",[559,615,616],{"class":565}," '",[559,618,619],{"class":586},"@tresjs/cientos",[559,621,622],{"class":565},"'\n",[559,624,626],{"class":561,"line":625},3,[559,627,629],{"emptyLinePlaceholder":628},true,"\n",[559,631,633,636,639,641,645,648,651,654,656],{"class":561,"line":632},4,[559,634,635],{"class":573},"const",[559,637,638],{"class":606}," currentAnimation ",[559,640,580],{"class":565},[559,642,644],{"class":643},"s2Zo4"," ref",[559,646,647],{"class":606},"(",[559,649,650],{"class":565},"'",[559,652,653],{"class":586},"cientosIdle",[559,655,650],{"class":565},[559,657,658],{"class":606},")\n",[559,660,662,665,667],{"class":561,"line":661},5,[559,663,664],{"class":565},"\u003C/",[559,666,570],{"class":569},[559,668,592],{"class":565},[559,670,672],{"class":561,"line":671},6,[559,673,629],{"emptyLinePlaceholder":628},[559,675,677,679,682],{"class":561,"line":676},7,[559,678,566],{"class":565},[559,680,681],{"class":569},"template",[559,683,592],{"class":565},[559,685,687,690,693],{"class":561,"line":686},8,[559,688,689],{"class":565},"  \u003C",[559,691,692],{"class":569},"TresCanvas",[559,694,592],{"class":565},[559,696,698,701,704],{"class":561,"line":697},9,[559,699,700],{"class":565},"    \u003C",[559,702,703],{"class":569},"Suspense",[559,705,592],{"class":565},[559,707,709,712],{"class":708,"line":549},[561,596],[559,710,711],{"class":565},"      \u003C",[559,713,714],{"class":569},"AnimatedSprite\n",[559,716,718,721,723,725,728],{"class":717,"line":550},[561,596],[559,719,720],{"class":573},"        image",[559,722,580],{"class":565},[559,724,583],{"class":565},[559,726,727],{"class":586},"https://raw.githubusercontent.com/Tresjs/assets/main/textures/animated-sprite/cientosTexture.png",[559,729,730],{"class":565},"\"\n",[559,732,734,737,739,741,744],{"class":733,"line":551},[561,596],[559,735,736],{"class":573},"        atlas",[559,738,580],{"class":565},[559,740,583],{"class":565},[559,742,743],{"class":586},"https://raw.githubusercontent.com/Tresjs/assets/main/textures/animated-sprite/cientosAtlas.json",[559,745,730],{"class":565},[559,747,749,752,754,756,759],{"class":748,"line":552},[561,596],[559,750,751],{"class":573},"        :animation",[559,753,580],{"class":565},[559,755,583],{"class":565},[559,757,758],{"class":586},"currentAnimation",[559,760,730],{"class":565},[559,762,764],{"class":763,"line":553},[561,596],[559,765,766],{"class":565},"      />\n",[559,768,770,773,775],{"class":561,"line":769},15,[559,771,772],{"class":565},"    \u003C/",[559,774,703],{"class":569},[559,776,592],{"class":565},[559,778,780,783,785],{"class":561,"line":779},16,[559,781,782],{"class":565},"  \u003C/",[559,784,692],{"class":569},[559,786,592],{"class":565},[559,788,790,792,794],{"class":561,"line":789},17,[559,791,664],{"class":565},[559,793,681],{"class":569},[559,795,592],{"class":565},[797,798,799],"prose-warning",{},[510,800,801,803,804,807],{},[513,802,515],{}," loads resources asynchronously, so it must be wrapped in a ",[513,805,806],{},"\u003CSuspense />",".",[539,809,811],{"id":810},"compiling-an-atlas","Compiling an atlas",[510,813,814,815,817],{},"In typical usage, ",[513,816,515],{}," requires both the URL to a texture of compiled sprite images and a JSON atlas containing information about the sprites in the texture.",[529,819,820,826],{},[532,821,822],{},[518,823,825],{"href":727,"rel":824},[522],"example compiled texture",[532,827,828],{},[518,829,831],{"href":743,"rel":830},[522],"example JSON atlas",[510,833,834,835,840],{},"Compiling source images into a texture atlas is usually handled by third-party software. You may find ",[518,836,839],{"href":837,"rel":838},"https://www.codeandweb.com/texturepacker",[522],"TexturePacker"," useful.",[539,842,844],{"id":843},"without-an-atlas","Without an atlas",[510,846,847,848,851],{},"There may be cases where you don't want to supply an atlas to the ",[513,849,850],{},"atlas"," prop. To do so:",[529,853,854,857,860,863],{},[532,855,856],{},"Compile your source images into a single image texture.",[532,858,859],{},"Space each sprite into equally sized columns and rows in the compiled image texture.",[532,861,862],{},"Ensure no extra padding has been added to the compiled image texture.",[532,864,865,866,868,869,807],{},"Set the ",[513,867,850],{}," prop to number of columns, number of rows as ",[513,870,871],{},"[number, number]",[539,873,875],{"id":874},"spritesheets-in-the-wild","Spritesheets in the wild",[797,877,878],{},[510,879,880,881,883],{},"In the wild, spritesheets are often distributed without atlases and the images are often compiled by hand. It can be difficult or impossible to use these resources directly with ",[513,882,515],{},". In many cases, it's advisable to recompile the spritesheet.",[885,886,888],"h3",{"id":887},"how-to-recompile-an-existing-spritesheet-image","How to recompile an existing spritesheet image",[529,890,891,894,897,900,913],{},[532,892,893],{},"Cut individual sprites from the spritesheet and paste them into separate layers in an image editing application, e.g., GIMP.",[532,895,896],{},"Align the layers for animation. Toggling layer visibility on/off will show you how the animation will display, frame to frame.",[532,898,899],{},"Export layers as individual images.",[532,901,902,903,906,909,910,912],{},"Name the individual images according to the following pattern: ",[904,905],"br",{},[513,907,908],{},"[animation name][frame number].[extension]"," ",[904,911],{},"E.g., walk000.png, walk001.png, idle000.png, idle001.png",[532,914,915],{},"Compile individual images into an image texture and atlas using a texture packing application, like TexturePacker.",[539,917,919],{"id":918},"props","Props",[921,922,923,940],"table",{},[924,925,926],"thead",{},[927,928,929,934,937],"tr",{},[930,931,933],"th",{"align":932},"left","Name",[930,935,936],{"align":932},"Description",[930,938,939],{"align":932},"Default",[941,942,943,957,997,1057,1072,1088,1113,1128,1142,1156,1170,1189,1213,1233,1252],"tbody",{},[927,944,945,949,955],{},[946,947,948],"td",{"align":932},"image",[946,950,951,954],{"align":932},[513,952,953],{},"string"," – URL of the image texture or an image dataURL. This prop is not reactive.",[946,956],{"align":932},[927,958,959,961,995],{},[946,960,850],{"align":932},[946,962,963,966,967,992,994],{"align":932},[513,964,965],{},"string | Atlasish"," – ",[529,968,969,975,981,986],{},[532,970,971,972,974],{},"If ",[513,973,953],{},", the URL of the JSON atlas.",[532,976,971,977,980],{},[513,978,979],{},"number",", the number of columns in the texture.",[532,982,971,983,985],{},[513,984,871],{},", the number of columns/rows in the texture.",[532,987,971,988,991],{},[513,989,990],{},"AtlasData",", the atlas as a JS object.",[904,993],{},"This prop is not reactive.",[946,996],{"align":932},[927,998,999,1002,1055],{},[946,1000,1001],{"align":932},"definitions",[946,1003,1004,1007,1008,1010,1011,1013,1015,1016,1018,1020,1021],{"align":932},[513,1005,1006],{},"Record\u003Cstring, string>"," – Specify playback frame order and repeated frames (delays). ",[513,1009,1001],{}," is a record where keys are atlas animation names and values are strings containing an animation definition.",[904,1012],{},[904,1014],{},"A \"animation definition\" comma-separated string of frame numbers with optional parentheses-surrounded durations.",[904,1017],{},[904,1019],{},"Here is how various definition strings convert to arrays of frames for playback:",[529,1022,1023,1030,1037,1043,1049],{},[532,1024,1025,1026,1029],{},"\"0,2,1\" - ",[559,1027,1028],{},"0,2,1",", i.e., play frame 0, 2, then 1.",[532,1031,1032,1033,1036],{},"\"2(10)\" - ",[559,1034,1035],{},"2,2,2,2,2,2,2,2,2,2",", i.e., play from 2 10 times.",[532,1038,1039,1040],{},"\"1-4\" - ",[559,1041,1042],{},"1,2,3,4",[532,1044,1045,1046],{},"\"10-5(2)\" - ",[559,1047,1048],{},"10,10,9,9,8,8,7,7,6,6,5,5",[532,1050,1051,1052],{},"\"1-4(3),10(2)\" - ",[559,1053,1054],{},"1,1,1,2,2,2,3,3,3,4,4,4,10,10",[946,1056],{"align":932},[927,1058,1059,1062,1067],{},[946,1060,1061],{"align":932},"fps",[946,1063,1064,1066],{"align":932},[513,1065,979],{}," – Desired frames per second of the animation.",[946,1068,1069],{"align":932},[513,1070,1071],{},"30",[927,1073,1074,1077,1083],{},[946,1075,1076],{"align":932},"loop",[946,1078,1079,1082],{"align":932},[513,1080,1081],{},"boolean"," – Whether or not the animation should loop.",[946,1084,1085],{"align":932},[513,1086,1087],{},"true",[927,1089,1090,1093,1108],{},[946,1091,1092],{"align":932},"animation",[946,1094,1095,1098,1099,1101,1102,1104,1105,1107],{"align":932},[513,1096,1097],{},"string | [number, number] | number"," – If ",[513,1100,953],{},", name of the animation to play. If ",[513,1103,871],{},", start and end frames of the animation. If ",[513,1106,979],{},", frame number to display.",[946,1109,1110],{"align":932},[513,1111,1112],{},"0",[927,1114,1115,1118,1123],{},[946,1116,1117],{"align":932},"paused",[946,1119,1120,1122],{"align":932},[513,1121,1081],{}," – Whether the animation is paused.",[946,1124,1125],{"align":932},[513,1126,1127],{},"false",[927,1129,1130,1133,1138],{},[946,1131,1132],{"align":932},"reversed",[946,1134,1135,1137],{"align":932},[513,1136,1081],{}," – Whether to play the animation in reverse.",[946,1139,1140],{"align":932},[513,1141,1127],{},[927,1143,1144,1147,1152],{},[946,1145,1146],{"align":932},"flipX",[946,1148,1149,1151],{"align":932},[513,1150,1081],{}," – Whether the sprite should be flipped, left to right.",[946,1153,1154],{"align":932},[513,1155,1127],{},[927,1157,1158,1161,1166],{},[946,1159,1160],{"align":932},"resetOnEnd",[946,1162,1163,1165],{"align":932},[513,1164,1081],{}," – For a non-looping animation, when the animation ends, whether to display the zeroth frame.",[946,1167,1168],{"align":932},[513,1169,1127],{},[927,1171,1172,1175,1185],{},[946,1173,1174],{"align":932},"asSprite",[946,1176,1177,1179,1180],{"align":932},[513,1178,1081],{}," – Whether to display the object as a THREE.Sprite. ",[518,1181,1184],{"href":1182,"rel":1183},"https://threejs.org/docs/?q=sprite#api/en/objects/Sprite",[522],"See THREE.Sprite",[946,1186,1187],{"align":932},[513,1188,1087],{},[927,1190,1191,1194,1208],{},[946,1192,1193],{"align":932},"center",[946,1195,1196,1199,1200,1203,1204,1207],{"align":932},[513,1197,1198],{},"TresVector2"," – Anchor point of the object. A value of ",[559,1201,1202],{},"0.5, 0.5"," corresponds to the center. ",[559,1205,1206],{},"0, 0"," is left, bottom.",[946,1209,1210],{"align":932},[513,1211,1212],{},"[0.5, 0.5]",[927,1214,1215,1218,1228],{},[946,1216,1217],{"align":932},"alphaTest",[946,1219,1220,1222,1223],{"align":932},[513,1221,979],{}," – Alpha test value for the material. ",[518,1224,1227],{"href":1225,"rel":1226},"https://threejs.org/docs/#api/en/materials/Material.alphaTest",[522],"See THREE.Material.alphaTest",[946,1229,1230],{"align":932},[513,1231,1232],{},"0.0",[927,1234,1235,1238,1248],{},[946,1236,1237],{"align":932},"depthTest",[946,1239,1240,1242,1243],{"align":932},[513,1241,1081],{}," – Depth test value for the material. ",[518,1244,1247],{"href":1245,"rel":1246},"https://threejs.org/docs/#api/en/materials/Material.depthTest",[522],"See THREE.Material.depthTest",[946,1249,1250],{"align":932},[513,1251,1087],{},[927,1253,1254,1257,1267],{},[946,1255,1256],{"align":932},"depthWrite",[946,1258,1259,1261,1262],{"align":932},[513,1260,1081],{}," – Depth write value for the material. ",[518,1263,1266],{"href":1264,"rel":1265},"https://threejs.org/docs/#api/en/materials/Material.depthWrite",[522],"See THREE.Material.depthWrite",[946,1268,1269],{"align":932},[513,1270,1087],{},[539,1272,1274],{"id":1273},"events","Events",[921,1276,1277,1289],{},[924,1278,1279],{},[927,1280,1281,1284,1286],{},[930,1282,1283],{},"Event",[930,1285,936],{},[930,1287,1288],{},"Argument",[941,1290,1291,1306,1327],{},[927,1292,1293,1298,1301],{},[946,1294,1295],{},[513,1296,1297],{},"frame",[946,1299,1300],{},"Emitted when the displayed animation frame changes – at most once per tick, frames may be dropped",[946,1302,1303,1305],{},[513,1304,953],{}," – Name of the newly displayed frame",[927,1307,1308,1313,1322],{},[946,1309,1310],{},[513,1311,1312],{},"end",[946,1314,1315,1316,1319,1320],{},"Emitted when the animation ends – ",[513,1317,1318],{},"props.loop"," must be set to ",[513,1321,1127],{},[946,1323,1324,1326],{},[513,1325,953],{}," – Name of the ending frame",[927,1328,1329,1333,1340],{},[946,1330,1331],{},[513,1332,1076],{},[946,1334,1335,1336,1319,1338],{},"Emitted when the animation loops – ",[513,1337,1318],{},[513,1339,1087],{},[946,1341,1342,1344],{},[513,1343,953],{}," – Name of the frame at the end of the loop",[539,1346,1347],{"id":1092},"Animation",[510,1349,1350,1351,1354],{},"The ",[513,1352,1353],{},":animation"," prop holds either the name of the currently playing animation or a range of frames to play, or a frame number to display.",[885,1356,1358],{"id":1357},"using-named-animations-as-animation","Using named animations as animation",[510,1360,1361],{},"When individual files are converted to a spritesheet/atlas, typically the original images' filenames will be included in the atlas.",[510,1363,1364,1366],{},[513,1365,515],{}," uses those filenames to automatically group images into animations.",[510,1368,1369],{},"Use either of the following naming conventions for your source images ...",[529,1371,1372,1377],{},[532,1373,1374],{},[513,1375,1376],{},"[animation name][frame number].[file_extension]",[532,1378,1379],{},[513,1380,1381],{},"[animation name]_[frame number].[file_extension]",[510,1383,1384,1385,1387,1388,1391,1392,1394,1395,1397],{},"... then ",[513,1386,515],{}," will automatically make all ",[513,1389,1390],{},"[animation name]"," available for playback. Just pass ",[513,1393,1390],{}," to the component's ",[513,1396,1353],{}," prop.",[885,1399,1401],{"id":1400},"example","Example",[510,1403,1404],{},"For our Cientos heart cartoon character animation, here's how the filenames map to animation names.",[921,1406,1407,1417],{},[924,1408,1409],{},[927,1410,1411,1414],{},[930,1412,1413],{},"Filenames",[930,1415,1416],{},"Animation name",[941,1418,1419,1426,1434],{},[927,1420,1421,1424],{},[946,1422,1423],{},"cientosIdle0000.png, cientosIdle0001.png, ...",[946,1425,653],{},[927,1427,1428,1431],{},[946,1429,1430],{},"cientosIdleToWalkTransition0000.png",[946,1432,1433],{},"cientosIdleToWalkTransition",[927,1435,1436,1439],{},[946,1437,1438],{},"cientosWalk0000.png, cientosWalk0001.png, ...",[946,1440,1441],{},"cientosWalk",[539,1443,1444],{"id":1001},"Definitions",[510,1446,1447,1448,1451,1452,1456],{},"You can supply an object to the ",[513,1449,1450],{},":definitions"," prop. Any ",[518,1453,1455],{"href":1454},"#animation","named animation"," can be a key. The value is a string that specifies frame order and delays.",[885,1458,1460],{"id":1459},"demo","Demo",[510,1462,1463,1464,1466,1467,807],{},"In this demo, the 'idle' animation is comprised of six different images. By default, those images will play sequentially when the ",[513,1465,1353],{}," prop is ",[513,1468,1469],{},"'idle'",[510,1471,1472,1473,1475,1476,1479],{},"But below, we've added a ",[513,1474,1450],{}," prop with this value for the ",[513,1477,1478],{},"idle"," key:",[543,1481,1486],{"className":1482,"code":1484,"language":1485},[1483],"language-text","'0-5, 0(10), 1-2, 3(20), 4-5, 0-5(3)'\n","text",[513,1487,1484],{"__ignoreMap":555},[510,1489,1490],{},"So, instead of playing images 0-5 sequentially, this animation will play instead:",[529,1492,1493,1502,1516],{},[532,1494,1495,1498,1499,1501],{},[513,1496,1497],{},"0-5"," – Play all six images (",[513,1500,1497],{},") of the animation normally.",[532,1503,1504,1507,1508,1511,1512,1515],{},[513,1505,1506],{},"0(10), 1-2, 3(20), 4-5"," – Play all six images again with a delay of ten frames at the bottom of the bounce (",[513,1509,1510],{},"0(10)",") and a delay of twenty frames at the top of the bounce (",[513,1513,1514],{},"3(20)",").",[532,1517,1518,1521],{},[513,1519,1520],{},"0-5(3)"," – Finally, play all six images of the animation with a delay of three frames each.",[539,1523,1524],{"id":1193},"Center",[510,1526,1527,1528,1531],{},"In addition to being the sprite's anchor point, the ",[513,1529,1530],{},":center"," prop also controls how differently sized source images will \"grow\" and \"shrink\". Namely, they \"grow out from\" and \"shrink towards\" the center.",[1533,1534,1535],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":555,"searchDepth":562,"depth":548,"links":1537},[1538,1539,1540,1541,1544,1545,1546,1550,1553],{"id":541,"depth":548,"text":15},{"id":810,"depth":548,"text":811},{"id":843,"depth":548,"text":844},{"id":874,"depth":548,"text":875,"children":1542},[1543],{"id":887,"depth":625,"text":888},{"id":918,"depth":548,"text":919},{"id":1273,"depth":548,"text":1274},{"id":1092,"depth":548,"text":1347,"children":1547},[1548,1549],{"id":1357,"depth":625,"text":1358},{"id":1400,"depth":625,"text":1401},{"id":1001,"depth":548,"text":1444,"children":1551},[1552],{"id":1459,"depth":625,"text":1460},{"id":1193,"depth":548,"text":1524},"Display 2D animations defined in a texture atlas.","md",null,{},{"title":425,"description":1554},"1Fefoz-lCiLy_IhyyeC3jSJZXqD9LUr1drneDRIGstI",[1561,1563],{"title":419,"path":420,"stem":421,"description":1562,"children":-1},"3D objects and texture components",{"title":429,"path":430,"stem":431,"description":1564,"children":-1},"Render environment maps for reflective objects.",1789116513072]