public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Screenshotter sc = (Screenshotter)target;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Screenshot"))
        {
            sc.TakeScreenshot();
        }
    }
Example #2
0
 private void frmDrawInstance_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button.Equals(MouseButtons.Left))
     {
         _isSet         = false;
         Cursor.Current = Cursors.Default;
         this.Hide(); // prevent the form from being visible on the screenshot
         Screenshotter.TakeScreenshot(Application.StartupPath, _rect);
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else if (e.Button.Equals(MouseButtons.Right))
     {
         this.DialogResult = DialogResult.Cancel;
         this.Close();
     }
 }
Example #3
0
    /// <summary>
    /// Takes screenshot of current map and saves it to JPG file.
    /// </summary>
    private void MakeMapMiniature()
    {
        CameraSettings();

        for (int y = 0; y < mapSize.y; y++)
        {
            for (int x = 0; x < mapSize.x; x++)
            {
                grid[y, x].SetActive(false);
            }
        }

        cam.transform.GetChild(0).GetComponent <Camera>().enabled = false;
        Screenshotter.TakeScreenshot(Screenshotter.GetMapIconPath(mapPath), cam);
        cam.transform.GetChild(0).GetComponent <Camera>().enabled = true;

        for (int y = 0; y < mapSize.y; y++)
        {
            for (int x = 0; x < mapSize.x; x++)
            {
                grid[y, x].SetActive(true);
            }
        }
    }