Skip to content

Commit

Permalink
Add text example
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Jun 23, 2021
1 parent 8adc8f8 commit 738dc49
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/text_simple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import moderngl_window
from moderngl_window.text.bitmapped import TextWriter2D


class App(moderngl_window.WindowConfig):
title = "Text"
aspect_ratio = None

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.writer = TextWriter2D()
self.writer.text = "Hello ModernGL!"

def render(self, time, frame_time):
self.writer.draw((240, 380), size=120)


App.run()

0 comments on commit 738dc49

Please sign in to comment.