def on_mouse_motion(x, y, dx, dy): global index _, _, _, h = gl.glGetInteger(gl.GL_VIEWPORT) data['a_size'][index] = 25 data['a_position'][index] = x, h - y data['a_fg_color'][index] = 1, 1, 1, 1 index = (index + 1) % len(data)
def timer(fps): global index data['color'][..., 3] -= 0.01 data['size'] += data['growth'] _, _, w, h = gl.glGetInteger(gl.GL_VIEWPORT) data['position'][index] = np.random.uniform(0, 1, 2) * (w, h) data['size'][index] = 5 data['growth'][index] = np.random.uniform(.5, 1.5) data['color'][index] = 1, 1, 1, 1 index = (index + 1) % len(data)
def timer(fps): global index data['color'][..., 3] -= 0.01 data['size'] += data['growth'] _, _, w, h = gl.glGetInteger(gl.GL_VIEWPORT) data['position'][index] = np.random.uniform(0,1,2)*(w,h) data['size'][index] = 5 data['growth'][index] = np.random.uniform(.5,1.5) data['color'][index] = 1, 1, 1, 1 index = (index + 1) % len(data)