Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/caviar/src/entities/mod.ts>Rectangle

⚡ Blazing fast, modern, Game Engine powered by WebGPU for Deno and the browser
Latest
class Rectangle
extends Entity
import { Rectangle } from "https://deno.land/x/caviar@2.6.9/src/entities/mod.ts";

Constructors

new
Rectangle(
x: number,
y: number,
width: number,
height: number,
fill: RGBA | string,
)

Properties

bottom: number
down: number
fill: RGBA
left: number
right: number
up: number

Methods

collides(x: number, y: number): boolean
setAlpha(a: number): void
setFill(c: RGBA | string): void