tips_scr_030 - spoolkitamura/nyle-doc-jp GitHub Wiki
ๅใซๆ็ปใใๅ ๅฎนใๆฎใใใใซใใใซใฏ๏ผ
Screenใฏใฉในใๅๆๅใใ้ใซใ็ป้ขใๆฏๅใชใใฌใใทใฅใใใใฉใใใ
ๆๅฎใใใใจใใงใใพใใ
ไธ่จใฎใใใซใsuperใกใฝใใๅผๅบใๆใฎใชใใทใงใณtrace
ใ true
ใซใใใจ
็ป้ขใฎใชใใฌใใทใฅใใใใใๅใฎๆ็ปๅ
ๅฎนใๆฎใใใใซใชใใพใใ
[้ข้ฃๆ
ๅ ฑ]
Nyle-Screen
- ใใใฉใซใ(ๆฏๅใชใใฌใใทใฅใใฆๅใฎๆ็ปๅ ๅฎนใๆฎใใชใ)
require 'nyle'
class Screen < Nyle::Screen
def initialize
super
@x = 0
end
def draw
Nyle.draw_line(@x, 100, @x, 380, {color: :BLUE, a: @x / 1280.0})
@x += 5
@x = 0 if @x > 640
end
end
Screen.new.show_all
Nyle.main
[ๅฎ่ก็ตๆ]
![]() |
---|
- ใชใใฌใใทใฅใใใซๅใฎๆ็ปๅ ๅฎนใๆฎใ
require 'nyle'
class Screen < Nyle::Screen
def initialize
super({trace: true}) # trace: true ใๆๅฎใใใจๆ็ปๅ
ๅฎนใๆฎใ
@x = 0
end
def draw
Nyle.draw_line(@x, 100, @x, 380, {color: :BLUE, a: @x / 1280.0})
@x += 5
@x = 0 if @x > 640
end
end
Screen.new.show_all
Nyle.main
[ๅฎ่ก็ตๆ]
![]() |
---|