Description
The CreateToolbar
method is a virtual method of the Editor.Assets.AssetPreview
class. It is responsible for creating a widget that is displayed only when the user hovers over the asset preview. This method is useful for providing additional interactive elements or controls that are contextually relevant to the asset being previewed.
Usage
To use the CreateToolbar
method, you need to have an instance of the AssetPreview
class. You can call this method to generate a toolbar widget that will appear when the asset preview is hovered over. This can be particularly useful for adding custom controls or information related to the asset.
Example
// Assuming 'assetPreview' is an instance of AssetPreview
Editor.Widget toolbarWidget = assetPreview.CreateToolbar();
// You can now customize the toolbarWidget as needed
// For example, adding buttons or other UI elements
// toolbarWidget.AddChild(new Editor.Button("Action"));