Class: Console

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

Class Method Summary collapse

Class Method Details

.addColor(x, s) ⇒ Object

COLOR ##



74
75
76
77
78
79
# File 'lib/consolegl.rb', line 74

def self.addColor(x,s)

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

.BigSquareBottom(color) ⇒ Object



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

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

.BigSquareMiddle(color) ⇒ Object



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

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

.BigSquareTop(color) ⇒ Object



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

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

.ClearObject

CONSOLE ARGUMENTS ##



151
152
153
# File 'lib/consolegl.rb', line 151

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

.Draw(d) ⇒ Object

RENDERING ##



134
135
136
137
# File 'lib/consolegl.rb', line 134

def self.Draw(d)

    print(d)
end

.DrawWithNewLine(d) ⇒ Object



140
141
142
# File 'lib/consolegl.rb', line 140

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

.LineHorizontal(color) ⇒ Object



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

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

.LineVertical(color) ⇒ Object

ASCII CHARACTER RENDERING ##



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

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

.LongSquare(color) ⇒ Object



113
114
115
# File 'lib/consolegl.rb', line 113

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

.NewLineObject



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

def self.NewLine()
    puts ""
end

.PixelDown(color) ⇒ Object



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

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

.PixelMiddle(color) ⇒ Object



117
118
119
# File 'lib/consolegl.rb', line 117

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

.ResetConsoleColorObject



166
167
168
# File 'lib/consolegl.rb', line 166

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

.SetConsoleColor(value) ⇒ Object



162
163
164
# File 'lib/consolegl.rb', line 162

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

.SetTitle(title) ⇒ Object



156
157
158
# File 'lib/consolegl.rb', line 156

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