mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 17:18:50 +00:00
Compare commits
No commits in common. "52a234a23e0703598eb76132f8c44d06d404d5c0" and "c0ce4e60ee910ff4019f3540a4491827ddb1f437" have entirely different histories.
52a234a23e
...
c0ce4e60ee
2 changed files with 7 additions and 12 deletions
|
|
@ -301,11 +301,6 @@ impl App {
|
||||||
self.update_timer
|
self.update_timer
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the last frame time as computed by the renderer.
|
|
||||||
pub fn frame_dt(&self) -> f32 {
|
|
||||||
self.delta_time
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sets the amount of times the `App` game logic is updated per second
|
/// Sets the amount of times the `App` game logic is updated per second
|
||||||
pub fn set_update_rate(&mut self, update_rate: u32) {
|
pub fn set_update_rate(&mut self, update_rate: u32) {
|
||||||
if update_rate == 0 {
|
if update_rate == 0 {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ pub struct Camera2D {
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Text {
|
pub struct Text {
|
||||||
content: String,
|
content: &'static str,
|
||||||
font: &'static str,
|
font: &'static str,
|
||||||
font_size: f32,
|
font_size: f32,
|
||||||
color: Color,
|
color: Color,
|
||||||
|
|
@ -462,14 +462,14 @@ impl Camera for Camera2D {
|
||||||
|
|
||||||
impl Text {
|
impl Text {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
content: impl Into<String>,
|
content: &'static str,
|
||||||
font: &'static str,
|
font: &'static str,
|
||||||
font_size: f32,
|
font_size: f32,
|
||||||
is_visible: bool,
|
is_visible: bool,
|
||||||
color: impl ColorTrait,
|
color: impl ColorTrait,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
content: content.into(),
|
content,
|
||||||
font,
|
font,
|
||||||
font_size,
|
font_size,
|
||||||
color: Color::from_wgpu_color(color.to_wgpu()),
|
color: Color::from_wgpu_color(color.to_wgpu()),
|
||||||
|
|
@ -478,12 +478,12 @@ impl Text {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn content(&self) -> &str {
|
pub fn content(&self) -> &'static str {
|
||||||
&self.content
|
self.content
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_content(&mut self, content: impl Into<String>) {
|
pub fn set_content(&mut self, content: &'static str) {
|
||||||
self.content = content.into();
|
self.content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn font(&self) -> &'static str {
|
pub fn font(&self) -> &'static str {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue