Sha256: c36d79e81b5ef4010b52aa2d7ea40c3b3201d95b972ec2b6e8ecf024e9210bbd

Contents?: true

Size: 745 Bytes

Versions: 42

Compression:

Stored size: 745 Bytes

Contents

puts "\n Methods such as go, rcprint, and putch \n can accept symbols such as"
puts " :top :bottom :left :right :center"
puts "\n Of course, printing starting at the far right \n can be problematic."

win = RubyText.window(7, 29, r: 1, c: 60, fg: Red, bg: Black)

win.putch "1", r: :bottom, c: :left;                 sleep 0.4
win.go :center, :left;               win.puts "abc"; sleep 0.4
win.go :top, :left;                  win.puts "def"; sleep 0.4
win.rcprint :top, :center, "4";                      sleep 0.4

others = [[:top, :right, "5"], [:center, :right, "6"], [:bottom, :right, "7"], 
          [:bottom, :center, "8"], [:center, :center, "9"]] 
others.each do |args| 
  r, c, ch = *args
  win.go r,c
  win.putch(ch)
  sleep 0.4
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rubytext-0.0.86 examples/prog23.rb
rubytext-0.0.85 examples/prog23.rb