#!ruby -Ks # -*- mode: ruby; encoding: sjis -*- # Last updated: <2014/03/29 23:13:11 +0900> # # Webフォントを表示してみるテスト # require 'dxruby' Font.install("./common_icons.ttf") iconfont = Font.new(76, "common_icons") imgs = Hash.new() ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"].each do |c| imgs[c] = Image.new(96, 96) imgs[c].drawFontEx(4, 4, c, iconfont, :edge=>true, :edge_width=>4, :color=>[255, 128, 0], :edge_color=>[0, 0, 0]) end Window.bgcolor = [64, 64, 64] # メインループ Window.loop do break if Input.keyPush?(K_ESCAPE) # ESCが押されたら終了 x = 0 y = 0 imgs.each_key do |key| Window.draw(x, y, imgs[key]) x += imgs[key].width if x > Window.width - imgs[key].width x = 0 y += imgs[key].height end end end