0
나는 여기에 앉아있는 것은 내가 생각할 수없는 매우 단순한 버그라고 생각한다. 루가와 함께 Gosu 보석으로 게임을 만드는 법을 배우려하고 있지만 속도는 빨라졌다. 충돌. 여기 내 코드가있다.Ruby에 Gosu로 텍스트를 인쇄 할 수 없다
require "gosu"
class Hello < Gosu::Window
def initialize width = 800, height = 600, fullscreen = false
super
self.caption = "Ruby Practise"
@image = Gosu::Image.from_text self. "My text to print".
Gosu.default_font_name.
100
end
def button_down id
close if id == Gosu::KbEscape
end
def update
end
def draw
@image.draw 0, 0, 0
end
end
Hello.new.show
무엇인가 잘못되었지만 무엇을 모르겠다. 나는 그것에 적어도 1 시간을 보냈다. 그것은 문자열에 불평한다, 여기 터미널에서 출력이다.
hello.rb:8: syntax error, unexpected tSTRING_BEG
@image = Gosu::Image.from_text self. "My text to print".
^
hello.rb:10: syntax error, unexpected tINTEGER
나는 잘못하고있는 것이 아니라 어떤 것을 알고 있습니까? 아마 정말 간단 뭔가 .. 별도의 함수 인수가 아닌 점에
이 너무 간단 내가 tryed했다 싸웠다하지만 sertan 장소에 그것을 놓친 아. 고맙습니다! – Salviati