Exemplo n.º 1
0
        /// <summary>
        /// Do updates.
        /// </summary>
        protected override void Update(double deltaTime)
        {
            // if user click 'exit' action, exit game
            if (Input.Down("exit"))
            {
                Game.Exit();
            }

            // if user click 's', save image
            if (Input.ReleasedNow(KeyCodes.KeyS))
            {
                _targetTexture.SaveToFile("demo.png");
            }

            // if user click 'p', pause image movement
            if (Input.ReleasedNow(KeyCodes.KeyP))
            {
                _paused = !_paused;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Saves an image file.
 /// </summary>
 /// <param name="image">Image asset to save.</param>
 /// <param name="path">Output file path.</param>
 /// <param name="useAssetsRoot">If true, will append path to assets root. If false, will treat it as relative path to working directory.</param>
 /// <returns>True if saving was successful.</returns>
 public void SaveImage(ImageAsset image, string path, bool useAssetsRoot = true)
 {
     image.SaveToFile(useAssetsRoot ? ToAssetsPath(path, false) : path);
 }