Garry's Mod
Screenshot Editor
 Questa discussione è stata messa in evidenza. Probabilmente è importante.
Chev  [sviluppatore] 1 gen 2023, ore 11:53
Developer API basics
Adding a frame or filter
Create a client-sided Lua file. The placement of the file does not matter as long as the Lua file runs before GM:Initialize.
Create a hook with the name ScreenshotEditorInitialize.

In this hook, you can use screenshot_editor.AddFrame and screenshot_editor.AddFilter to add frames and filters.

Example usage for AddFrame:
screenshot_editor.AddFrame({ FrameName = "Display Name", MaterialPath = "path/to/material.png" })

Example usage for AddFilter:
screenshot_editor.AddFilter({ FilterName = "Display Name", FilterCallback = function(width, height, screenshotMat) -- Surface/render code goes here. -- Width and height are the size of the screenshot editor panel -- (which should be the same as the game's resolution) -- screenshotMat is the IMaterial for the screenshot -- currently being rendered. end })

Creating the editor VGUI menu
Simply use:
vgui.Create("DScreenshotEditor")
Ultima modifica da Chev; 1 gen 2023, ore 12:13