Status report: I have color and text sizing < Help me.
This commit is contained in:
+14
-9
@@ -4,19 +4,24 @@ use eframe::egui;
|
||||
pub struct AniShio {}
|
||||
|
||||
impl AniShio {
|
||||
pub fn new(cc: &eframe::CreationContext<'_>) -> Self {
|
||||
// Customize egui here with cc.egui_ctx.set_fonts and cc.egui_ctx.set_global_style.
|
||||
// Restore app state using cc.storage (requires the "persistence" feature).
|
||||
// Use the cc.gl (a glow::Context) to create graphics shaders and buffers that you can use
|
||||
// for e.g. egui::PaintCallback.
|
||||
pub fn new(_cc: &eframe::CreationContext<'_>) -> Self {
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
impl eframe::App for AniShio {
|
||||
fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
ui.heading("Hello World!");
|
||||
});
|
||||
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
egui::CentralPanel::default()
|
||||
.frame(egui::Frame::NONE.fill(egui::Color32::from_rgba_unmultiplied(163, 136, 219, 80)))
|
||||
.show_inside(ui, |ui| {
|
||||
ui.heading(
|
||||
egui::RichText::new("AniShio")
|
||||
.color(egui::Color32::BLACK)
|
||||
.size(28.0),
|
||||
)
|
||||
});
|
||||
}
|
||||
fn clear_color(&self, _visuals: &egui::Visuals) -> [f32; 4] {
|
||||
egui::Color32::from_rgba_unmultiplied(163, 136, 219, 80).to_normalized_gamma_f32()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user