Custom editor for a specific component type.
More...
#include <CustomEditor.h>
Inherits DekiEditor::EditorExtension.
Custom editor for a specific component type.
Provides inspector customization and display size info for components. Similar to Unity's CustomEditor attribute.
Inherits from EditorExtension for registration with REGISTER_EDITOR macro.
Usage:
{
public:
{
auto* sprite = static_cast<SpriteComponent*>(comp);
outWidth = sprite->width;
outHeight = sprite->height;
return true;
}
};
#define REGISTER_EDITOR(EditorClass)
Macro for auto-registering editor extensions.
Definition EditorRegistry.h:133
Base class for all components (data-only).
Definition DekiComponent.h:51
Custom editor for a specific component type.
Definition CustomEditor.h:47
virtual bool GetDisplaySize(DekiComponent *comp, float &outWidth, float &outHeight)
Get display size for the component.
Definition CustomEditor.h:116
virtual const char * GetComponentName() const =0
Get the name of the component this editor handles.
◆ ~CustomEditor()
| virtual DekiEditor::CustomEditor::~CustomEditor |
( |
| ) |
|
|
virtualdefault |
◆ GetEditorType()
| EditorType DekiEditor::CustomEditor::GetEditorType |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetName()
| const char * DekiEditor::CustomEditor::GetName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetComponentName()
| virtual const char * DekiEditor::CustomEditor::GetComponentName |
( |
| ) |
const |
|
pure virtual |
Get the name of the component this editor handles.
- Returns
- Component type name (e.g., "SpriteComponent")
◆ WantsInspectorOverride()
| virtual bool DekiEditor::CustomEditor::WantsInspectorOverride |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
Check if this editor wants to override the inspector.
- Parameters
-
| comp | The component being inspected |
- Returns
- True to call OnInspectorGUI instead of default property editor
◆ OnInspectorGUI()
| virtual void DekiEditor::CustomEditor::OnInspectorGUI |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
Draw custom inspector GUI.
- Parameters
-
| comp | The component being inspected |
Only called if WantsInspectorOverride() returns true.
Use EditorUI::Get() to access:
- DrawDefaultInspector() - draw all properties
- PropertyField(name) - draw specific property
- PropertyField(offset) - draw property by offset
◆ OnEditorUpdate()
| virtual void DekiEditor::CustomEditor::OnEditorUpdate |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
Called every frame before rendering for all components with editors.
- Parameters
-
Use this for lazy sync or dirty-checking that needs to run regardless of whether the object is selected.
◆ GetDisplaySize()
| virtual bool DekiEditor::CustomEditor::GetDisplaySize |
( |
DekiComponent * | comp, |
|
|
float & | outWidth, |
|
|
float & | outHeight ) |
|
inlinevirtual |
Get display size for the component.
- Parameters
-
| comp | The component |
| outWidth | Output width |
| outHeight | Output height |
- Returns
- True if component has a display size
◆ HitTest()
| virtual bool DekiEditor::CustomEditor::HitTest |
( |
DekiComponent * | comp, |
|
|
float | localX, |
|
|
float | localY, |
|
|
float | width, |
|
|
float | height ) |
|
inlinevirtual |
Hit test a point against the component.
- Parameters
-
| comp | The component |
| localX | Local X coordinate (relative to object center) |
| localY | Local Y coordinate (relative to object center) |
| width | Display width |
| height | Display height |
- Returns
- True if point is inside component bounds
◆ GetTextureAssetGuid()
| virtual std::string DekiEditor::CustomEditor::GetTextureAssetGuid |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
Get the texture asset GUID for this component (if any).
- Parameters
-
- Returns
- Asset GUID or empty string
◆ GetResizeTarget()
| virtual void DekiEditor::CustomEditor::GetResizeTarget |
( |
DekiComponent * | comp, |
|
|
int32_t ** | outWidth, |
|
|
int32_t ** | outHeight ) |
|
inlinevirtual |
Get resize target pointers.
- Parameters
-
| comp | The component |
| outWidth | Output pointer to width field |
| outHeight | Output pointer to height field |
◆ OnDrawGizmos()
| virtual void DekiEditor::CustomEditor::OnDrawGizmos |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
◆ OnDrawGizmosSelected()
| virtual void DekiEditor::CustomEditor::OnDrawGizmosSelected |
( |
DekiComponent * | comp | ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file: