EditorSproutyDialogsPortraitEditor
Inherits: VBoxContainer
Description
This module allows the user to edit a portrait for a character. It provides a preview of the portrait and allows the user to set various properties and settings including transform settings (scale, rotation, offset, mirror) and exported properties from the portrait scene.
Properties
| Type | Name | Default |
|---|---|---|
| EditorUndoRedoManager | undo_redo | null |
Methods
| Return Type | Method |
|---|---|
| SproutyDialogsPortraitData | get_portrait_data() |
| void | load_portrait_data(name: String, data: SproutyDialogsPortraitData) |
| void | set_portrait_name(name: String) |
| void | update_preview_transform(parent_transform: Dictionary) |
Signals
signal modified(modified: bool)
Emitted when the portrait is modified.
Property Descriptions
var undo_redo : EditorUndoRedoManager
UndoRedo manager for handling undo/redo operations in the portrait editor.
Method Descriptions
func get_portrait_data() -> SproutyDialogsPortraitData
Returns the portrait data from the editor. This includes the portrait scene path, export property overrides, and transform settings (scale, offset, rotation, mirror).
func load_portrait_data(name: String, data: SproutyDialogsPortraitData) -> void
Load the portrait data into the editor. The name parameter is used to set the portrait name in the preview. This method loads the portrait scene, export overrides, and transform settings.
func set_portrait_name(name: String) -> void
Set the portrait name displayed in the editor.
func update_preview_transform(parent_transform: Dictionary = {}) -> void
Update the preview scene with the transformation settings.