RubyGL. 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rubygl.rb +138 -0
  3. metadata +43 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ab8235a2fe4423bad396131299fe44bae3d248d9d47f5ca8f6dfc339b5888220
4
+ data.tar.gz: '0937538b01f9fb519db5b48113357f4388f392daca5aa9df37e8a2afd19a21b5'
5
+ SHA512:
6
+ metadata.gz: db042232b845e3b886f4ba47e9a445f9ce210681fc7464aa36397dfa93b4aed99ce8f421df5de2ec648a09c4a33d0ee5d92cea5c1d151fb94f6eaf044769bc9b
7
+ data.tar.gz: 401e878afaf9a8041f11adee5218b15491c8965a0e012dcd545e72eca2538a6aca96269fcb8ac859ea48ca59ec5371436fdebdfe682ccf293e9a01f8f12d5575
@@ -0,0 +1,138 @@
1
+ """
2
+ RubyGL Version 1.0 || DOCS
3
+
4
+ class: Color
5
+ # Color IDs
6
+ RED
7
+ GREEN
8
+ YELLOW
9
+ BLUW
10
+ LIGHT_BLUE
11
+ WHITE
12
+
13
+ class: Console
14
+ addColor(x, s):
15
+ Adds Color to string or number
16
+ Params:
17
+ X = COLOR ID
18
+ S = STRING OR NUMBER
19
+ Usage:
20
+ addColor(Color.RED, 'ERROR')
21
+ LineVertical(color):
22
+ Returns a Vertical Line
23
+ Params:
24
+ Color = COLOR ID
25
+ Usage:
26
+ LineVertical(Color.BLUE)
27
+
28
+ """
29
+ class Color
30
+
31
+ ## COLOR VALUE ##
32
+
33
+ RED = 31
34
+ GREEN = 32
35
+ YELLOW = 33
36
+ BLUE = 34
37
+ LIGHT_BLUE = 36
38
+ WHITE = false
39
+
40
+ end
41
+
42
+
43
+ class Console
44
+ ## COLOR ##
45
+
46
+ def self.addColor(x,s)
47
+
48
+ if x != false:
49
+ "\e[#{x}m#{s.to_s}\e[0m"
50
+ end
51
+
52
+
53
+
54
+
55
+
56
+ #############################################
57
+ ### ASCII RENDERING ###
58
+ #############################################
59
+
60
+
61
+
62
+ ## ASCII CHARACTER RENDERING ##
63
+
64
+ def self.LineVertical(color)
65
+ return addColor(color, "─")
66
+ end
67
+
68
+ def self.LineHorizontal(color)
69
+ return addColor(color, "│")
70
+
71
+ def self.BigSquareMiddle(color)
72
+ return addColor(color, "■")
73
+ end
74
+
75
+ def self.BigSquareTop(color)
76
+ return addColor(color, "▀")
77
+ end
78
+
79
+ def self.BigSquareBottom(color)
80
+ return addColor(color, "▄")
81
+ end
82
+
83
+ def self.LongSquare(color)
84
+ return addColor(color,"█")
85
+ end
86
+
87
+ def self.PixelMiddle(color)
88
+ return addColor(color, "·")
89
+ end
90
+
91
+ def self.PixelDown(color)
92
+ return addColor(color, ".")
93
+ end
94
+
95
+
96
+
97
+ ############################################
98
+ #### CONSOLE RENDERING ####
99
+ ############################################
100
+
101
+
102
+ ## RENDERING ##
103
+
104
+ def self.Draw(d)
105
+
106
+ print(d)
107
+ end
108
+
109
+
110
+ def self.DrawWithNewLine(d)
111
+ puts(d)
112
+ end
113
+
114
+ def self.NewLine()
115
+ puts ""
116
+ end
117
+
118
+
119
+ ## CONSOLE ARGUMENTS ##
120
+
121
+ def self.Clear()
122
+ Gem.win_platform? ? (system "cls") : (system "clear")
123
+ end
124
+
125
+
126
+ def self.SetTitle(title)
127
+ system "title " + title.to_s
128
+ end
129
+
130
+
131
+
132
+ def SetConsoleColor(value)
133
+ system "COLOR " + value.to_s +
134
+ end
135
+
136
+ def ResetConsoleColor()
137
+ system "COLOR 07"
138
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: RubyGL.
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Okistuff
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Rendering Engine for Ruby kind of similar to OpenGL. It runs in the console
14
+ email: okistuffyt@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/rubygl.rb
20
+ homepage: https://rubygems.org/gems/RubyGL
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.0.3
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Rendering Engine for Ruby
43
+ test_files: []