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

x/caviar/src/entities/physics/mod.ts>PhysicsRectangle

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

Constructors

new
PhysicsRectangle(
_scene: PhysicsScene,
x: number,
y: number,
width: number,
height: number,
fill: string | RGBA,
config?: PhysicsConfig,
)

Properties

body: any
bottom: number
down: number
fill: RGBA
height: number
left: number
right: number
up: number
width: number

Methods

applyForce(force: Vector | IVectorLike): void
setAlpha(a: number): void
setAngularVelocity(velocity: number): void
setFill(c: RGBA | string): void
setVelocity(velocity: Vector | IVectorLike): void