Texture video rendering in LibGDX

I'm new to libgdx
I am creating a game, and I have an animated background that has about 10 seconds of animation (250 aprox frames.), Since it is useless to try to build a sprite sheet for this (large background, of course) is there any way to render the video files are a png sequence for textures, so can I use my animated background in the game?

+6
source share
3 answers

There is currently an extension for playing gdx-video video .

+3
source

If your idea is to put the texture in the background and render the image and replace it in time to give an animated frame, then a good start looks here: How to draw a texture into a square with OpenGL ES 2?

+1
source

I play libname - "indiespot-media-0.8.09.jar" site

How to use:

  • dowload full zip
  • copy the lib folder in the root of proj (ffmpeg will open lib using the path. / lib / ffmpeg / ffmpeg @os postfix @)
  • player = new MoviePlayer(videoFile); Texure playerTexture = new Texture(player.movie.width(), player.movie.height(), Pixmap.Format.RGBA8888) { @Override public void bind() { Gdx.gl.glBindTexture(0, player.textureHandle); } }; 
  • use playerTexture as usual texture
-1
source

Source: https://habr.com/ru/post/909458/


All Articles