Last active
August 14, 2018 07:06
-
-
Save Tsumio/c64322c2e5ca75b4b71fca8ae50755b3 to your computer and use it in GitHub Desktop.
Play original video on the map scene.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requestAnimationFrame(() => { | |
//Note:何もしない。 | |
//Note:コアスクリプトのバージョンによっては、これを呼んでおかないと音声のみの再生になる。 | |
}); | |
const playOriginalVideo = function() { | |
//テクスチャとSpriteの生成 | |
const texture = new PIXI.Texture.fromVideo('movies/testmovie-640x360.webm');//ファイル名指定 | |
const videoSprite = new PIXI.Sprite(texture); | |
//ビデオのサイズを設定 | |
videoSprite.width = 640; | |
videoSprite.height = 360; | |
//ループを設定 | |
texture.baseTexture.source.loop = true; | |
//Z座標を設定しておく | |
//Note:これはツクールのコアスクリプトがchildrenの順番を勝手にソートするため。 | |
videoSprite.z = 1; | |
//シーンの_tilemap用コンテナにaddChildする | |
//Note:マップシーン以外で呼ぶとエラーを起こす | |
SceneManager._scene.children[0]._tilemap.addChild(videoSprite); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment