diff --git a/src/runtime/primitive_functions.rs b/src/runtime/primitive_functions.rs index 4552d0f..ffbd9e3 100644 --- a/src/runtime/primitive_functions.rs +++ b/src/runtime/primitive_functions.rs @@ -83,7 +83,7 @@ fn draw_text(args: Vec) -> ast::Value { } _ => todo!(), }; - mq::draw_text(&text, x, y, size, color); + mq::draw_text(&text, x * SCALE, y * SCALE, size * SCALE, color); ast::UNIT_VALUE } @@ -108,6 +108,9 @@ fn to_f32(value: Option<&ast::Expr>) -> f32 { fn to_string(value: Option<&ast::Expr>) -> String { match value { Some(ast::Expr::Value(ast::Value::String(s))) => s.clone(), + Some(ast::Expr::Value(ast::Value::Float(f))) => format!("{f:.2}"), + Some(ast::Expr::Value(ast::Value::Int(i))) => format!("{i}"), + Some(ast::Expr::Value(ast::Value::Boolean(b))) => format!("{b}"), _ => "".into(), } } diff --git a/src/runtime/runtime.rs b/src/runtime/runtime.rs index 44c7be5..018260a 100644 --- a/src/runtime/runtime.rs +++ b/src/runtime/runtime.rs @@ -191,7 +191,7 @@ pub fn draw(state: &mut State) { Ok(_) => {} Err(err) => println!("Error: {}", err), } - draw_fps(); + // draw_fps(); /* println!(