Horizontal text is left-aligned by default. Set align to 1 to center the text and to 2 to right-align it. Vertical text is always centered.
def 合适高度 24 end x = Sprite.new.tap{|s| s.bitmap = Bitmap.new(Graphics.width, Graphics.height).tap{|b| b.fill_rect(b.rect, Color.new(255,255,255)) b.draw_text(b.rect.tap{|r| r.height = 合适高度}, "Tester Tester") } } loop{Graphics.update}
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |