Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::Edit::ClassElements Namespace Reference

Variables

static const AZ::Crc32 EditorData
 This element enables you to add attributes that apply to an entire class. More...
 
static const AZ::Crc32 Group
 This element represents a logical group that you can add attributes to. More...
 

Variable Documentation

◆ EditorData

const AZ::Crc32 AZ::Edit::ClassElements::EditorData
static

This element enables you to add attributes that apply to an entire class.

A class should not have more than one of these.

Expected value type: This can be any value (the value is unused).

Example: The following example shows how to add classwide attributes to the edit context reflection of EditorAreaLightComponent.

editContext->Class<EditorAreaLightComponent>("Area Light", "Attaches area lighting to an entity.")
->Attribute(AZ::Edit::Attributes::Category, "Rendering")
->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/AreaLight.png")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c))

◆ Group

const AZ::Crc32 AZ::Edit::ClassElements::Group
static

This element represents a logical group that you can add attributes to.

When you create a group, subsequent data elements are indented and placed under an expander in Lumberyard Editor.

Expected value type: AZStd::string. This is used as the group's name.

Example: Assume that you want to create a group called Decal Settings that contains two data elements, Offset and Visible, that are expanded in Lumberyard Editor as follows:

+ Decal Settings <-- not expanded
- Decal Settings <-- expanded
Offset [ ]
Visible [ ]

The corresponding reflection code is the following:

editContext->Class<DecalConfig>("Render Settings", "Decal rendering options.")
->ClassElement(AZ::Edit::ClassElements::Group, "Decal Settings")
->DataElement(0, &DecalConfig::m_position, "Offset", "")
->Attribute(AZ::Edit::Attributes::ChangeNotify, &DecalConfig::MinorPropertyChanged)
->DataElement(0, &DecalConfig::m_visible, "Visible", "")
->Attribute(AZ::Edit::Attributes::ChangeNotify, &DecalConfig::MinorPropertyChanged);