mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-01 05:43:01 +00:00
17 lines
645 B
Lua
17 lines
645 B
Lua
---
|
|
-- @module worldeditadditions.sculpt.brushes
|
|
|
|
--- Returns a simple square brush with 100% weight for every pixel.
|
|
-- Default inbuilt brush.
|
|
-- @name square
|
|
-- @param size Vector3 The desired size of the brush. Only the x and y components are used; the z component is ignored.
|
|
-- @returns bool,number[],Vector3 1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.
|
|
return function(size)
|
|
local result = {}
|
|
for y=0, size.y do
|
|
for x=0, size.x do
|
|
result[y*size.x + x] = 1
|
|
end
|
|
end
|
|
return true, result, size
|
|
end
|