ScenePaint2DEditor
Class for interacting with the 2D editor's Scene Paint Mode.
Class for interacting with the 2D editor's Scene Paint Mode.
This class is available only in the editor and cannot be instantiated. Access it using EditorInterface.GetScenePaint2D.
It provides methods for editor plugins to interact with the scene painting tool.
Plugins can register custom scene providers, and set the scene to be painted.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Methods4
GetPaintedSceneEntity2D
public Entity2D GetPaintedScene();Returns the painted scene, or null if none is selected. The returned scene's properties can be edited.
Warning: Removing and freeing this node will render the editor useless and may cause a crash.
Entity2DRegisterSceneProvidervoid
public void RegisterSceneProvider(Control control, Callable callback);Registers a custom scene provider.
When the scene picker tool is active and the user clicks on control, the callback is invoked and must return a Entity2D.
The returned scene becomes the new painting sample.
| Name | Type | Default |
|---|---|---|
control | Control | — |
callback | Callable | — |
SetPaintedScenevoid
public void SetPaintedScene(Entity2D scene);Sets the scene sample to be painted.
| Name | Type | Default |
|---|---|---|
scene | Entity2D | — |
UnregisterSceneProvidervoid
public void UnregisterSceneProvider(Control control);Removes a previously registered scene provider.
| Name | Type | Default |
|---|---|---|
control | Control | — |
Signals and events1
ScenePaintedEvent
public event ScenePaint2DEditor.ScenePaintedEventHandler ScenePainted;Emitted for each new node created during drawing. Example:
| Name | Type | Default |
|---|---|---|
node | Entity2D | — |