use bevy::{prelude::*, text::LineHeight};
pub(super) const DEFAULT_SIZE_SMALL: f32 = 20.0;
pub(super) const DEFAULT_SIZE_MEDIUM: f32 = 40.0;
pub(super) const DEFAULT_SIZE_LARGE: f32 = 100.0;
pub(super) const DEFAULT_SIZE_EXTRA_LARGE: f32 = 120.0;
pub trait UiText: Default {
fn small(value: &str, font: &Handle<Font>) -> Self {
Self::default()
.font(font)
.size(DEFAULT_SIZE_SMALL)
.text(Text::new(value))
}
fn medium(value: &str, font: &Handle<Font>) -> Self {
Self::default()
.size(DEFAULT_SIZE_MEDIUM)
.font(font)
.text(Text::new(value))
}
fn large(value: &str, font: &Handle<Font>) -> Self {
Self::default()
.size(DEFAULT_SIZE_LARGE)
.font(font)
.text(Text::new(value))
}
fn extra_large(value: &str, font: &Handle<Font>) -> Self {
Self::default()
.size(DEFAULT_SIZE_EXTRA_LARGE)
.font(font)
.text(Text::new(value))
}
fn color(self, color: TextColor) -> Self;
fn font(self, font: &Handle<Font>) -> Self;
fn size(self, size: f32) -> Self;
fn text(self, text: Text) -> Self;
fn line_height(self, line_height: LineHeight) -> Self;
fn justify(self, justify: Justify) -> Self;
fn line_break(self, line_break: LineBreak) -> Self;
}