icon for user interface resource

This commit is contained in:
Dmitry Stepanov
2023-12-22 14:14:35 +03:00
parent 787a9f6a94
commit 484ef9185c
2 changed files with 23 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

+23 -1
View File
@@ -10,7 +10,7 @@ use fyrox::{
TypeUuidProvider,
},
fxhash::FxHashMap,
gui::font::Font,
gui::{font::Font, UserInterface},
material::{shader::Shader, Material, MaterialResource, PropertyValue},
resource::{
curve::CurveResourceState,
@@ -45,6 +45,7 @@ impl AssetPreviewGeneratorsCollection {
this.add(HrirSphereResourceData::type_uuid(), HrirPreview);
this.add(CurveResourceState::type_uuid(), CurvePreview);
this.add(Font::type_uuid(), FontPreview);
this.add(UserInterface::type_uuid(), UserInterfacePreview);
this
}
@@ -310,3 +311,24 @@ impl AssetPreview for FontPreview {
load_image(include_bytes!("../../resources/font.png"))
}
}
pub struct UserInterfacePreview;
impl AssetPreview for UserInterfacePreview {
fn generate(
&mut self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
_scene: &mut Scene,
) -> Handle<Node> {
Handle::NONE
}
fn icon(
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
load_image(include_bytes!("../../resources/ui.png"))
}
}