-
Notifications
You must be signed in to change notification settings - Fork 5
light.um
Marek Maskarinec edited this page Sep 14, 2022
·
1 revision
<b>TO BE DELETED<b>
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.
type Spotlight* = struct {
pos: th.Vf2
radius: th.uu
tint: uint32
}
A circular light that can be plotted onto a mask.
fn (m: ^Mask) clear*() {
Clears the lightmask to have it's own default color.
fn mk*(color: uint32, rectSize: real, cam: rect.Rect): Mask {
fn (m: ^Mask) draw*(cam: rect.Rect) {
Draws a lightmask.
fn (s: ^Spotlight) stamp*(m: ^Mask, cam: rect.Rect) {
Stamps a spotlight onto a mask.