@@ -114,6 +114,21 @@ local function make_line(pos1, pos2, color, name, time, density)
114114 })
115115end
116116
117+ local function make_point (pos , color , name , time , density )
118+ return minetest .add_particlespawner ({
119+ playername = name ,
120+ time = time ,
121+ amount = density * 2 ,
122+ minpos = pos ,
123+ maxpos = pos ,
124+ minexptime = 2.0 ,
125+ maxexptime = 2.0 ,
126+ texture = " vizlib_particle.png^[multiply:" .. color ,
127+ glow = 14 ,
128+ size = 1.5 ,
129+ })
130+ end
131+
117132---- ----------------------------------------------
118133-- API Functions. See API.md for details.
119134---- ----------------------------------------------
@@ -129,6 +144,12 @@ function vizlib.random_color()
129144 return string.format (" #%02x%02x%02x" , r , g , b )
130145end
131146
147+ function vizlib .draw_point (pos , options )
148+ local color , name , time , density = get_valid_options (options )
149+ local ids = make_point (pos , color , name , time , density )
150+ return make_shape (name , time , ids )
151+ end
152+
132153function vizlib .draw_circle (pos , radius , axis , options )
133154 local color , name , time , density = get_valid_options (options )
134155 local ids = {}
0 commit comments