Class responsible for displaying and navigating project assets within an ImGUI window.
More...
#include <AssetBrowser.hpp>
|
| | AssetBrowser (const std::string &rootPath) |
| | Constructs the AssetBrowser.
|
| std::string | Draw (const BrowserIcons &icons, float &thumbnailSize, bool showBottomBar=true, float height=0.0f) |
| | Draws the Asset Browser UI and handles interaction.
|
| int | GetJSONAssetType (const std::string path) |
| | Determines the type of a JSON asset (e.g., scene, material, etc.).
|
| std::string | GetExtension (const std::string path) |
| | Extracts the file extension from a path.
|
| void | setPadding (float padding) |
| | Sets the padding between asset icons in the browser.
|
| std::string | getCurrentPath () const |
| | Gets the currently viewed directory path.
|
|
| ImTextureID | GetIcon (const std::filesystem::directory_entry &entry, const BrowserIcons &icons) |
| | Gets the appropriate icon texture ID for a given directory entry.
|
Class responsible for displaying and navigating project assets within an ImGUI window.
Definition at line 29 of file AssetBrowser.hpp.
◆ AssetBrowser()
| vex::AssetBrowser::AssetBrowser |
( |
const std::string & | rootPath | ) |
|
Constructs the AssetBrowser.
- Parameters
-
| const | std::string& rootPath - The root directory of the project assets. |
Definition at line 13 of file AssetBrowser.cpp.
◆ Draw()
| std::string vex::AssetBrowser::Draw |
( |
const BrowserIcons & | icons, |
|
|
float & | thumbnailSize, |
|
|
bool | showBottomBar = true, |
|
|
float | height = 0.0f ) |
Draws the Asset Browser UI and handles interaction.
- Parameters
-
| const | BrowserIcons& icons - The set of icons to use for drawing assets. |
| float& | thumbnailSize - Reference to the thumbnail size from editor properties. |
| bool | showBottomBar - Whether to show the bottom slider bar. Set to false in file dialogs. |
| float | height - The height of the asset browser. If 0, uses available space. |
- Returns
- std::string - The path of the asset that was double-clicked/selected for action, or empty string otherwise.
Definition at line 45 of file AssetBrowser.cpp.
◆ getCurrentPath()
| std::string vex::AssetBrowser::getCurrentPath |
( |
| ) |
const |
|
inline |
Gets the currently viewed directory path.
- Returns
- std::string - The current path as a string.
Definition at line 67 of file AssetBrowser.hpp.
◆ GetExtension()
| std::string vex::AssetBrowser::GetExtension |
( |
const std::string | path | ) |
|
Extracts the file extension from a path.
- Parameters
-
| const | std::string path - The file path. |
- Returns
- std::string - The file extension (e.g., ".png", ".scene").
Definition at line 38 of file AssetBrowser.cpp.
◆ GetIcon()
| ImTextureID vex::AssetBrowser::GetIcon |
( |
const std::filesystem::directory_entry & | entry, |
|
|
const BrowserIcons & | icons ) |
|
private |
Gets the appropriate icon texture ID for a given directory entry.
- Parameters
-
| const | std::filesystem::directory_entry& entry - The file system entry. |
| const | BrowserIcons& icons - The collection of available icons. |
- Returns
- ImTextureID - The texture ID of the selected icon.
Definition at line 17 of file AssetBrowser.cpp.
◆ GetJSONAssetType()
| int vex::AssetBrowser::GetJSONAssetType |
( |
const std::string | path | ) |
|
Determines the type of a JSON asset (e.g., scene, material, etc.).
- Parameters
-
| const | std::string path - The file path to check. |
- Returns
- int - An integer code representing the asset type.
Definition at line 334 of file AssetBrowser.cpp.
◆ setPadding()
| void vex::AssetBrowser::setPadding |
( |
float | padding | ) |
|
|
inline |
Sets the padding between asset icons in the browser.
- Parameters
-
| float | padding - The new padding value. |
Definition at line 63 of file AssetBrowser.hpp.
◆ m_copiedPath
| std::filesystem::path vex::AssetBrowser::m_copiedPath |
|
private |
◆ m_currentPath
| std::filesystem::path vex::AssetBrowser::m_currentPath |
|
private |
◆ m_isCut
| bool vex::AssetBrowser::m_isCut = false |
|
private |
◆ m_padding
| float vex::AssetBrowser::m_padding = 16.0f |
|
private |
◆ m_renameBuffer
| char vex::AssetBrowser::m_renameBuffer[256] = "" |
|
private |
◆ m_renamePath
| std::filesystem::path vex::AssetBrowser::m_renamePath |
|
private |
◆ m_renaming
| bool vex::AssetBrowser::m_renaming = false |
|
private |
◆ m_rootPath
| std::filesystem::path vex::AssetBrowser::m_rootPath |
|
private |
◆ m_searchBuffer
| char vex::AssetBrowser::m_searchBuffer[256] = "" |
|
private |
The documentation for this class was generated from the following files: