简体   繁体   中英

rendering video on a texture in LibGDX

i am new to LibGDX
i'm building a game and i have an animated background that has about 10 seconds of animation (250 frames aprox.) since it's useless to try and build a sprite sheet for this (large background of course) is there a way to render video files are png sequence to a texture so i can have my animated background drawn in the game?

现在有视频播放gdx-video的扩展。

如果您的想法是在背景上放置纹理并渲染图像并及时替换它以给出动画帧,那么这里有一个好的开始: 如何使用OpenGL ES 2将纹理绘制成四边形?

I is the way to play, libname is "indiespot-media-0.8.09.jar" site

How to use:

  1. dowload full zip
  2. copy lib folder in the root of proj (ffmpeg will be opened by lib with path ./lib/ffmpeg/ffmpeg@os postfix@)
  3.  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); } }; 
  4. use playerTexture as usual texture

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM