summaryrefslogtreecommitdiffhomepage
path: root/mrblib/raylib.rb
blob: fb45ad8106c341564a72c143ab6bda9dd4d6f14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Rl = Raylib

module Raylib
  class << self
    attr_accessor :main_loop

    def while_window_open(&block)
      self.main_loop = block
      if Raylib.platform == 'desktop'
        while !Raylib.window_should_close? do
          self.main_loop.call
        end
      elsif Raylib.platform == 'web'
        Raylib.emscripten_set_main_loop
      end
    end


    def draw_text(text:, x:, y:, font_size:, color:)
      self._draw_text(text, x, y, font_size, color)
    end
  end
end