Status report: I have color and text sizing < Help me.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "anishio"
|
name = "anishio"
|
||||||
author = "inorishio"
|
author = ["inorishio"]
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
|
|||||||
+14
-9
@@ -4,19 +4,24 @@ use eframe::egui;
|
|||||||
pub struct AniShio {}
|
pub struct AniShio {}
|
||||||
|
|
||||||
impl AniShio {
|
impl AniShio {
|
||||||
pub fn new(cc: &eframe::CreationContext<'_>) -> Self {
|
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.
|
|
||||||
Self::default()
|
Self::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl eframe::App for AniShio {
|
impl eframe::App for AniShio {
|
||||||
fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
|
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
egui::CentralPanel::default()
|
||||||
ui.heading("Hello World!");
|
.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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-4
@@ -1,12 +1,21 @@
|
|||||||
mod app;
|
mod app;
|
||||||
|
|
||||||
use app::AniShio;
|
use app::AniShio;
|
||||||
|
use eframe::egui;
|
||||||
|
|
||||||
|
fn main() -> eframe::Result {
|
||||||
|
let mut window = eframe::NativeOptions::default();
|
||||||
|
window.viewport = egui::ViewportBuilder::default()
|
||||||
|
.with_title("AniShio")
|
||||||
|
.with_app_id("AniShioID")
|
||||||
|
.with_inner_size([400.0, 300.0])
|
||||||
|
.with_min_inner_size([400.0, 300.0])
|
||||||
|
.with_resizable(true)
|
||||||
|
.with_transparent(true);
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let native_options = eframe::NativeOptions::default();
|
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
"AniShio",
|
"AniShio",
|
||||||
native_options,
|
window,
|
||||||
Box::new(|cc| Ok(Box::new(AniShio::new(cc)))),
|
Box::new(|cc| Ok(Box::new(AniShio::new(cc)))),
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user