Last active
September 21, 2021 19:40
-
-
Save andr-ew/1c8bc88e260eace46e69615c3874513e to your computer and use it in GitHub Desktop.
nest_ z-index example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include 'nest_/lib/nest/core' | |
include 'nest_/lib/nest/norns' | |
include 'nest_/lib/nest/grid' | |
-- when a nest draws affordances, it sorts them by increasing z values and draws them in that order | |
n = nest_ { | |
higher = _grid.number { | |
x = { 1, 16 }, | |
y = 1, | |
lvl = 15, | |
z = 0 -- 0 is the default value for z, so it doesn't need to be set explicitly | |
}, | |
lower = _grid.range { -- (hold down two keys in row 1 to use the range affordance) | |
x = { 1, 16 }, | |
y = 1, | |
lvl = 8, | |
z = -1 -- setting z to anything less than 0 ensures it to be drawn underneath | |
} | |
} :connect { g = grid.connect() } | |
--both affordances still receive input from key presses. if you want more control over this, you can use fingers to filter by the number of concurrent keypresses | |
function init() n:init() end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment