Garry's Mod
Screenshot Editor
 Тема закреплена. Скорее всего, здесь есть важная информация.
Chev  [Разработчик] 1 янв. 2023 г. в 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")
Отредактировано Chev; 1 янв. 2023 г. в 12:13