Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Nov 24, 2021
1 parent 182d98d commit 9d964d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Screenshot/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ private void Input_ButtonPressed(object sender, StardewModdingAPI.Events.ButtonP
if (!Directory.Exists(Config.ScreenshotFolder))
Directory.CreateDirectory(Config.ScreenshotFolder);

Color[] data = new Color[Game1.viewport.Width * Game1.viewport.Height];
var width = Game1.graphics.GraphicsDevice.PresentationParameters.BackBufferWidth;
var height = Game1.graphics.GraphicsDevice.PresentationParameters.BackBufferHeight;

Color[] data = new Color[width * height];
Game1.graphics.GraphicsDevice.GetBackBufferData(data);
Texture2D tex = new Texture2D(Game1.graphics.GraphicsDevice, Game1.viewport.Width, Game1.viewport.Height);
Texture2D tex = new Texture2D(Game1.graphics.GraphicsDevice, width, height);
tex.SetData(data);
Stream stream = File.Create(Path.Combine(Config.ScreenshotFolder, screenshot_name));
tex.SaveAsPng(stream, tex.Width, tex.Height);
tex.SaveAsPng(stream, width, height);
stream.Close();

if(Config.Message.Length > 0)
Expand Down
2 changes: 1 addition & 1 deletion Screenshot/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Screenshot",
"Author": "aedenthorn",
"Version": "0.1.1",
"Version": "0.2.0",
"Description": "Screenshot.",
"UniqueID": "aedenthorn.Screenshot",
"EntryDll": "Screenshot.dll",
Expand Down
Binary file added _releases/Screenshot 0.2.0.zip
Binary file not shown.

0 comments on commit 9d964d4

Please sign in to comment.