Care is a very simple game framework focused solely on ease of use. The api is heavilty inspired by Löve 2D.
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.
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
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_releasedare available