Skip to content

light.um

Marek Maskarinec edited this page Sep 14, 2022 · 1 revision

light.um

 <b>TO BE DELETED<b>

struct Mask*

type Mask* = struct {
	dots: []uint32
	w, h: th.uu
	rectSize: th.fu
	color: uint32
}

Mask is a set of dots that can be edited and drawn to emulate light. You can even edit the dots yourself, but it won't look good with multiple lights. A function for plotting a pixel will be available soon.

struct Spotlight*

type Spotlight* = struct {
	pos: th.Vf2
	radius: th.uu
	tint: uint32
}

A circular light that can be plotted onto a mask.

fn clear*

fn (m: ^Mask) clear*() {

Clears the lightmask to have it's own default color.

fn mk*

fn mk*(color: uint32, rectSize: real, cam: rect.Rect): Mask {

fn draw*

fn (m: ^Mask) draw*(cam: rect.Rect) {

Draws a lightmask.

fn stamp*

fn (s: ^Spotlight) stamp*(m: ^Mask, cam: rect.Rect) {

Stamps a spotlight onto a mask.

Clone this wiki locally