liabru / matter-js

a 2D rigid body physics engine for the web ▲● ■

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to implement sprite looping animation?

JeongWuk opened this issue · comments

const guideLine = Matter.Bodies.rectangle(
      render.options.width / 2,
      render.options.height / 2,
      5,
      render.options.height / 2,
      {
        name: 'guideLine',
        isStatic: true, 
        isSensor: true, 
        collisionFilter: { group: -1 }, 
        render: {
          sprite: {
            texture: dotted[0].image,
            xScale: game_wrap.clientWidth / 450,
            yScale: game_wrap.clientHeight / 1226
          }
        }
      }
    )

I made a guideLine object which is a dotted line image, i want to make the sprite animate like a infinite swiper.
Is it possible?

Please see matter.js: is there any way to animate my sprite on Stack Overflow. If this doesn't work for you, share a complete example of your code and use case.