From 2b382a9179acdf7d2bf048745523d63ed7829f11 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Tue, 30 Sep 2025 10:57:41 +0300 Subject: [PATCH] docs + fixed warnings --- editor/src/asset/preview/mod.rs | 5 +---- editor/src/ui_scene/mod.rs | 1 - fyrox-impl/src/renderer/ui_renderer.rs | 8 ++++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/editor/src/asset/preview/mod.rs b/editor/src/asset/preview/mod.rs index 7e7a7c44e..242191312 100644 --- a/editor/src/asset/preview/mod.rs +++ b/editor/src/asset/preview/mod.rs @@ -35,10 +35,7 @@ use crate::{ engine::{Engine, GraphicsContext}, fxhash::FxHashMap, graph::{BaseSceneGraph, SceneGraphNode}, - graphics::{ - framebuffer::ReadTarget, - gpu_texture::{GpuTextureKind, PixelKind}, - }, + graphics::{framebuffer::ReadTarget, gpu_texture::GpuTextureKind}, gui::{ font::Font, formatted_text::WrapMode, screen::ScreenBuilder, text::TextBuilder, widget::WidgetBuilder, HorizontalAlignment, UserInterface, VerticalAlignment, diff --git a/editor/src/ui_scene/mod.rs b/editor/src/ui_scene/mod.rs index 9043cfa11..c61846924 100644 --- a/editor/src/ui_scene/mod.rs +++ b/editor/src/ui_scene/mod.rs @@ -41,7 +41,6 @@ use crate::{ engine::Engine, fxhash::FxHashSet, graph::{BaseSceneGraph, SceneGraph}, - graphics::gpu_texture::PixelKind, gui::{ brush::Brush, draw::{CommandTexture, Draw}, diff --git a/fyrox-impl/src/renderer/ui_renderer.rs b/fyrox-impl/src/renderer/ui_renderer.rs index 2192106fb..a57166130 100644 --- a/fyrox-impl/src/renderer/ui_renderer.rs +++ b/fyrox-impl/src/renderer/ui_renderer.rs @@ -96,11 +96,19 @@ pub struct UiRenderContext<'a, 'b, 'c> { pub resource_manager: &'a ResourceManager, } +/// Contains all the info required to render a user interface. pub struct UiRenderInfo<'a> { + /// A render target to render a user interface (UI) to. If [`None`], then the UI will be rendered + /// to the screen directly. pub render_target: Option, + /// Screen size for the UI. In most cases, it should be `ui.screen_size()`. pub screen_size: Vector2, + /// A drawing content of a UI. In most cases, it should be `ui.draw()`. pub drawing_context: &'a DrawingContext, + /// A color that will be used to fill a render target before rendering of the UI. Ignored if the + /// render target is [`None`] and nothing will be cleared. pub clear_color: Color, + /// A reference to the resource manager. pub resource_manager: &'a ResourceManager, }