Add fx components 291-320 and the home scene; Kit.Shot, Kit.Toward
Palette cycling, sky, sun and moon, clouds, starfield, rain, snow, petals, leaves, fireflies, waterfall, ocean, campfire, lava, aurora, lightning, mountains and a season scene; scanlines, vignette, screen shake, flash, dither fades, iris wipes, dissolves, mosaics, glitches, sparkles, explosions and confetti. Home opens on a live scene in the palette's season and a strip of all eight palettes. pixel adds Canvas.Cycled, Sprite.At, SpriteOf, Kit.Toward and Kit.Shot, which spends a cue under Reduce Motion so it never replays; display exports Reduce. Gallery grids and the sidebar are one Tab stop each.
This commit is contained in:
56 files changed
+3324
-101
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package fx
|
||||
|
||||
import (
|
||||
"github.com/egoist/mygo/ui"
|
||||
|
||||
"git.zacharyzhang.com/ZacharyZhang-NY/8bitMyGoUI/pixel"
|
||||
)
|
||||
|
||||
type ScanlinesOptions struct {
|
||||
// Slot shades the rows; zero means Shade.
|
||||
Slot pixel.Slot
|
||||
}
|
||||
|
||||
// Scanlines shades every other row of content at half strength.
|
||||
func Scanlines(c *ui.Context, o ScanlinesOptions, content func()) *ui.Element {
|
||||
k := pixel.K(c)
|
||||
s := slotOr(o.Slot, pixel.Shade)
|
||||
return cover(k, ui.Column(c), func(g pixel.Canvas) {
|
||||
for y := 1; y < g.H; y += 2 {
|
||||
g.Checker(0, y, g.W, 1, s)
|
||||
}
|
||||
}, content)
|
||||
}
|
||||
Reference in new issue
Block a user