1 unstable release

new 0.0.1 Mar 5, 2025

#13 in #care

Download history 119/week @ 2025-03-02

119 downloads per month

ISC license

155KB
3K SLoC

Care

Care is a very simple game framework focused solely on ease of use. The api is heavilty inspired by Löve 2D.

Hello World

Here's the source code for hello world with care, making a window appear that displays "hello world" (using the love2d-inspired interface).

#[care::draw]
fn draw() {
    care::graphics::text("Hello, World!", (20, 20));
}

care::main!();

You can also use the async interface (inspired by macroquad) if you want:

#[care::async_main]
async fn main() {
    loop {
        care::graphics::text("Hello, World!", (20, 20));

        care::event::next_frame().await;
    }
}

care::main!();

See examples in the examples directory or the rust doc for more information.

Comparison with love2d

Graphics

The namespace love.graphics and care::graphics.

  • Drawing
    • love.graphics.arc
    • love.graphics.circle
    • love.graphics.clear
    • love.graphics.discard
    • love.graphics.draw -> partial: texture, texture_scale, texture_source, texture_rot & texture_rounded
    • love.graphics.drawInstanced
    • love.graphics.drawLayer
    • love.graphics.ellipse
    • love.graphics.flushBatch
    • love.graphics.line -> line_segment, line & line_varying_styles
    • love.graphics.points
    • love.graphics.polygon -> partial: line & line_varying_styles
    • love.graphics.present
    • love.graphics.print -> partial: text
    • love.graphics.printf
    • love.graphics.rectangle -> rectangle, rectangle_rot & rectangle_rounded
    • love.graphics.stencil
  • Object Creation
    • love.graphics.newImage -> Texture::new, new_from_file_format, new_fill, new_from_image & new_from_data
    • love.graphics.newFont -> Font::new, Font::new_from_vec & Font::new_from_bytes
    • Many more...
  • Graphics State
    • love.graphics.setColor -> set_colour
    • love.graphics.setLineJoin -> set_line
    • love.graphics.setLineWidth -> Not needed
    • love.graphics.setLineStyle
    • Many more...
  • Coordinate System
  • Window
  • System Information

Keyboard

The namespace love.keyboard and care::keyboard.

  • love.keyboard.isDown -> is_down
  • love.keyboard.getKeyFromScancode
  • love.keyboard.getScancodeFromKey
  • love.keyboard.hasKeyRepeat
  • love.keyboard.hasScreenKeyboard
  • love.keyboard.hasTextInput
  • love.keyboard.isScancodeDown
  • love.keyboard.setKeyRepeat
  • love.keyboard.setTextInput
  • Additionally, is_pressed & is_released are available

Dependencies

~4–45MB
~741K SLoC