INNER CODE UNIT · Python

draw_event

mosra/magnum-examples · src/python/magnum-text.py:89

    def draw_event(self):
        gl.default_framebuffer.clear(gl.FramebufferClear.COLOR|
                                     gl.FramebufferClear.DEPTH)

        self._shader.bind_vector_texture(self._cache.texture)

        self._shader.transformation_projection_matrix = \
            Matrix3.projection(Vector2.x_scale(Vector2(self.window_size).aspect_ratio())) @ self._transformation_rotating_text
        self._shader.color = [0.184, 0.514, 0.8]
        self._shader.outline_color = [0.863, 0.863, 0.863]
        self._shader.outline_range = (0.45, 0.35)
        self._shader.smoothness = 0.025/\
            self._transformation_rotating_text.uniform_scaling()
        self._shader.draw(self._rotating_text.mesh)

        self._shader.transformation_projection_matrix = \
            Matrix3.projection(Vector2(self.window_size)) @\
            Matrix3.translation(Vector2(self.window_size)*0.5)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…