Class: Console

Inherits:
Object
  • Object
show all
Defined in:
lib/consolegl.rb

Class Method Summary collapse

Class Method Details

.addColor(x, s) ⇒ Object

COLOR ##



61
62
63
64
65
66
# File 'lib/consolegl.rb', line 61

def self.addColor(x,s)

    if x != false
        "\e[#{x}m#{s.to_s}\e[0m"
    end
end

.BigSquareBottom(color) ⇒ Object



96
97
98
# File 'lib/consolegl.rb', line 96

def self.BigSquareBottom(color)
    return addColor(color, "▄")
end

.BigSquareMiddle(color) ⇒ Object



88
89
90
# File 'lib/consolegl.rb', line 88

def self.BigSquareMiddle(color)
    return addColor(color, "■")
end

.BigSquareTop(color) ⇒ Object



92
93
94
# File 'lib/consolegl.rb', line 92

def self.BigSquareTop(color)
    return addColor(color, "▀")
end

.ClearObject

CONSOLE ARGUMENTS ##



138
139
140
# File 'lib/consolegl.rb', line 138

def self.Clear()
    Gem.win_platform? ? (system "cls") : (system "clear")
end

.Draw(d) ⇒ Object

RENDERING ##



121
122
123
124
# File 'lib/consolegl.rb', line 121

def self.Draw(d)

    print(d)
end

.DrawWithNewLine(d) ⇒ Object



127
128
129
# File 'lib/consolegl.rb', line 127

def self.DrawWithNewLine(d)
    puts(d)
end

.LineHorizontal(color) ⇒ Object



84
85
86
# File 'lib/consolegl.rb', line 84

def self.LineHorizontal(color)
    return addColor(color, "│")
end

.LineVertical(color) ⇒ Object

ASCII CHARACTER RENDERING ##



80
81
82
# File 'lib/consolegl.rb', line 80

def self.LineVertical(color)
    return addColor(color, "─")
end

.LongSquare(color) ⇒ Object



100
101
102
# File 'lib/consolegl.rb', line 100

def self.LongSquare(color)
    return addColor(color,"█")
end

.NewLineObject



131
132
133
# File 'lib/consolegl.rb', line 131

def self.NewLine()
    puts ""
end

.PixelDown(color) ⇒ Object



108
109
110
# File 'lib/consolegl.rb', line 108

def self.PixelDown(color)
    return addColor(color, ".")
end

.PixelMiddle(color) ⇒ Object



104
105
106
# File 'lib/consolegl.rb', line 104

def self.PixelMiddle(color)
    return addColor(color, "·")
end

.ResetConsoleColorObject



153
154
155
# File 'lib/consolegl.rb', line 153

def self.ResetConsoleColor()
    system "COLOR 07"
end

.SetConsoleColor(value) ⇒ Object



149
150
151
# File 'lib/consolegl.rb', line 149

def self.SetConsoleColor(value)
    system "COLOR " + value.to_s
end

.SetTitle(title) ⇒ Object



143
144
145
# File 'lib/consolegl.rb', line 143

def self.SetTitle(title)
    system "title " + title.to_s
end