@UberGoober Here’s an example using fillStyle. I draw 4 rows of blocks. When you tap the change parameter, I redraw 2 blocks, one above the other over the middle of each row based on the fillStyle.
The top row is CLEAR and doesn’t seem to do anything.
The next row down is UNION and draws a new cube only where a cube wasn’t drawn before.
The row below that is INTERSECT and draws a new block over an existing block, but not over a blank block.
The bottom row is REPLACE and draws a new block over an existing block and a blank block.
So I’m not sure if I’m doing something wrong or the doc isn’t explaining it right.
viewer.mode=STANDARD
function setup()
parameter.action("change",xxx)
assert(OrbitViewer, "Please include Cameras as a dependency")
scene = craft.scene()
v=scene.camera:add(OrbitViewer,vec3(5,5,0), 40, 0, 2000)
scene.voxels.blocks:addAssetPack("Blocks")
snow = scene.voxels.blocks:new("Snow")
snow.setTexture(ALL, "Blocks:Snow")
grass = scene.voxels.blocks:new("Grass Top")
grass.setTexture(ALL, "Blocks:Grass Top")
scene.voxels:resize(vec3(10,1,10))
scene.voxels.coordinates = vec3(0,0,0)
scene.voxels:fill("Snow")
for x=0,10 do
for y=0,9,3 do
scene.voxels:block(x,y,0)
end
end
end
function update(dt)
scene:update(dt)
end
function draw()
update(DeltaTime)
scene:draw()
end
function xxx()
scene.voxels:fillStyle(CLEAR)
scene.voxels:fill("Grass Top")
scene.voxels:block(5,9,0)
scene.voxels:block(5,10,0)
scene.voxels:fillStyle(UNION)
scene.voxels:fill("Grass Top")
scene.voxels:block(5,6,0)
scene.voxels:block(5,7,0)
scene.voxels:fillStyle(INTERSECT)
scene.voxels:fill("Grass Top")
scene.voxels:block(5,3,0)
scene.voxels:block(5,4,0)
scene.voxels:fillStyle(REPLACE)
scene.voxels:fill("Grass Top")
scene.voxels:block(5,0,0)
scene.voxels:block(5,1,0)
end