mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 15:18:43 -06:00
26 lines
761 B
Rust
26 lines
761 B
Rust
use glam::Vec2;
|
|
use crate::draw::UiDrawCommandList;
|
|
|
|
pub mod point;
|
|
mod rect;
|
|
pub mod stack;
|
|
pub mod nine_patch;
|
|
mod impls;
|
|
|
|
pub use rect::FrameRect;
|
|
|
|
pub trait Frame {
|
|
/// Draw the frame at the given position and size
|
|
fn draw(&self, draw: &mut UiDrawCommandList, position: Vec2, parent_size: Vec2);
|
|
|
|
/// Check if the frame is guaranteed to be fully opaque and fully cover the parent frame regardless of it's size
|
|
///
|
|
/// Returns true if the frame:
|
|
/// - Is fully opaque (i.e. `alpha >= 1.0`)
|
|
/// - Completely covers (or exceeds the size of) the frame
|
|
///
|
|
/// False negatives are acceptable, but false positives ***are not***.\
|
|
/// May be used for optimization purposes
|
|
fn covers_opaque(&self) -> bool { false }
|
|
}
|