code: def __init__(self):
      app.Canvas.__init__(
          self, title="Spacy", keys="interactive", size=(800, 600)
      )
  
      self.program = gloo.Program(vertex, fragment)
      self.view = np.eye(4, dtype=np.float32)
      self.model = np.eye(4, dtype=np.float32)
  
      self.activate_zoom()
  
      self.timer = app.Timer("auto", connect=self.update, start=True)
  
      # Set uniforms (some are set later)
      self.program["u_model"] = self.model
      self.program["u_view"] = self.view
      self.program["u_pixel_scale"] = self.pixel_scale
  
      # Set attributes
      self.program["a_position"] = np.zeros((N, 3), np.float32)
      self.program["a_offset"] = np.zeros((N, 1), np.float32)
  
      # Init
      self._timeout = 0
      self._active_block = 0
      for i in range(NBLOCKS):
          self._generate_stars()
      self._timeout = time.time() + SPEED
  
      gloo.set_state(
          clear_color="black",
          depth_test=False,
          blend=True,
          blend_equation="func_add",
          blend_func=("src_alpha", "one_minus_src_alpha"),
      )
  
      self.show()
  
file_path: vispy/examples/demo/gloo/spacy.py
imports: import time
  import numpy
  from vispy import gloo
  from vispy import app
  from vispy.util.transforms import perspective
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()