wasm4fun-graphics 0.1.0

Graphics primitives and subsystems for WASM-4 fantasy console
Documentation
// Copyright Claudio Mattera 2022.
//
// Distributed under the MIT License or the Apache 2.0 License at your option.
// See the accompanying files License-MIT.txt and License-Apache-2.0.txt, or
// online at
// https://opensource.org/licenses/MIT
// https://opensource.org/licenses/Apache-2.0

use wasm4fun_core::{hline, line, rect, vline};

/// Draw a rectangle using the current colours
pub fn draw_rect(x: i32, y: i32, width: u32, height: u32) {
    rect(x, y, width, height)
}

/// Draw a horizontal line using the current colours
pub fn draw_horizontal_line(x: i32, y: i32, width: u32) {
    hline(x, y, width)
}

/// Draw a vertical using the current colours
pub fn draw_vertical_line(x: i32, y: i32, height: u32) {
    vline(x, y, height)
}

/// Draw a line using the current colours
pub fn draw_line(x1: i32, y1: i32, x2: i32, y2: i32) {
    line(x1, y1, x2, y2)
}

/// Draw a vertical using the current colours
pub fn draw_point(x: i32, y: i32) {
    vline(x, y, 1)
}