-
Notifications
You must be signed in to change notification settings - Fork 9
Templates
abbie edited this page May 20, 2023
·
2 revisions
Like other image editors, Rawky has templates for new files. These specify the image size the template will have and a list of Guides that'll be applied to the file
Files can be place in the users /template
folder or for devs can be extracted out to it on launch using the following code in your plugin
FileUtils.copyResourcesRecursively(
MyPlugin::class.java.getResource("/template"),
RawkyPlugin.templateFolder
)
Templates are written in JSON, where just the name, width, height and guide file are given
{
"name": "template",
"width": 1920,
"height": 1080,
"guides": ["guide"]
}
A Template object can be added to the class's registry like so
Template.registry["template"] = Template(
name = "template",
width = 1920,
height = 1080,
guides = listOf("template")
)