Open 3D Engine AzToolsFramework API Reference 25.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::EditorViewportIconDisplayInterface Class Referenceabstract

An interface for loading simple icon assets and rendering them to screen on a per-viewport basis. More...

#include <EditorViewportIconDisplayInterface.h>

Classes

struct  DrawParameters
 These draw parameters control rendering for a single icon to a single viewport. More...
 

Public Types

enum class  CoordinateSpace : AZ::u8 { ScreenSpace , WorldSpace }
 
enum class  IconLoadStatus : AZ::u8 { Unloaded , Loading , Loaded , Error }
 The current load status of an icon retrieved by GetOrLoadIconForPath.
 
using IconId = AZ::s32
 

Public Member Functions

 AZ_RTTI (EditorViewportIconDisplayInterface, "{D5190B58-2561-4F3F-B793-F1E7D454CDF2}")
 
virtual void DrawIcon (const DrawParameters &drawParameters)=0
 
virtual void AddIcon (const DrawParameters &drawParameters)=0
 
virtual void DrawIcons ()=0
 
virtual IconId GetOrLoadIconForPath (AZStd::string_view path)=0
 
virtual IconLoadStatus GetIconLoadStatus (IconId icon)=0
 Gets the current load status of an icon retrieved via GetOrLoadIconForPath.
 

Static Public Attributes

static constexpr IconId InvalidIconId = -1
 

Detailed Description

An interface for loading simple icon assets and rendering them to screen on a per-viewport basis.

Member Function Documentation

◆ AddIcon()

virtual void AzToolsFramework::EditorViewportIconDisplayInterface::AddIcon ( const DrawParameters drawParameters)
pure virtual

Adds an icon to the upcoming draw batch. Use DrawIcons() after adding them all to actually commit them to the renderer. DrawParameters.m_viewport must be set to a valid viewport and must be the same viewport as all other invocations of AddIcon since the last call to DrawIcons (do one viewport at a time!)

◆ DrawIcon()

virtual void AzToolsFramework::EditorViewportIconDisplayInterface::DrawIcon ( const DrawParameters drawParameters)
pure virtual

Draws an icon (immediately) to a viewport given a set of draw parameters. Requires an IconId retrieved from GetOrLoadIconForPath. Note that this is an immediate draw request for backward compatability. For more efficient rendering, use the AddIcon method.

◆ DrawIcons()

virtual void AzToolsFramework::EditorViewportIconDisplayInterface::DrawIcons ( )
pure virtual

Call this after adding all of the icons via AddIcon. This commits all of them to the renderer, in batches organized per icon texture.

◆ GetOrLoadIconForPath()

virtual IconId AzToolsFramework::EditorViewportIconDisplayInterface::GetOrLoadIconForPath ( AZStd::string_view  path)
pure virtual

Retrieves a reusable IconId for an icon at a given path. This will load the icon, if it has not already been loaded.

Parameters
pathshould be a relative asset path to an icon image asset. png and svg icons are currently supported.

The documentation for this class was generated from the following file: