semanser Posted October 10, 2015 Share Posted October 10, 2015 Hi! I have this code and I need to save several images in Array, and then show them. How to do this?var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create });function preload () {game.load.script('webcam', '../plugins/WebCam.js');}var webcam;var bmd;var sprite;function create () {webcam = game.plugins.add(Phaser.Plugin.Webcam);bmd = game.make.bitmapData(800, 600);sprite = bmd.addToWorld();webcam.start(800, 600, bmd.context);game.input.onDown.addOnce(takePicture, this);}function takePicture () {webcam.stop();// bmd.context now contains your webcam imagesprite.tint = Math.random() * 0xff0000;} Link to comment Share on other sites More sharing options...
Recommended Posts