term_canvas 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/term_canvas.rb +22 -2
- data/lib/term_canvas/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1bd363ba44a888981070a4007ba190f3ca763da14f1c8114cf1860d994058a4
|
4
|
+
data.tar.gz: ca81ec589f2261c9a8bc1c7cc7d14fe81ce34c95ec9adce3dd0de18b4f7a819e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d719f57bada3cf8735c37584996606777d0bf31c25b9ce3a1ade260ff7f001dc7d3e38799143ec1d0c5d234aacc4dd4dea30881d9f4aef2b9ca26cd359e2a51f
|
7
|
+
data.tar.gz: 4fb2b1076922a5ca1513f6af742e81da81daf8d892eb6a039830d9c0368fc9a10427ff9676327234288f67c9a085073e9c5b0faa51dab695f94dbd18f598b731
|
data/Gemfile.lock
CHANGED
data/lib/term_canvas.rb
CHANGED
@@ -29,6 +29,12 @@ module TermCanvas
|
|
29
29
|
Curses.lines
|
30
30
|
end
|
31
31
|
|
32
|
+
# Update objects to physical screen.
|
33
|
+
def self.update
|
34
|
+
TermCanvas::BaseScreen.instance
|
35
|
+
Curses.doupdate
|
36
|
+
end
|
37
|
+
|
32
38
|
class Canvas
|
33
39
|
attr_accessor :width, :height
|
34
40
|
# Create a convenient window.
|
@@ -81,10 +87,24 @@ module TermCanvas
|
|
81
87
|
@object_index += 1
|
82
88
|
end
|
83
89
|
|
84
|
-
#
|
90
|
+
# @param color [Hash]
|
91
|
+
# :r Red element of color of background.
|
92
|
+
# :g Green element of color of background.
|
93
|
+
# :b Blue element of color of background.
|
94
|
+
def background(color)
|
95
|
+
object = TermCanvas::Rect.new(
|
96
|
+
x: 0, y: 0, width: @width - 1, height: @height,
|
97
|
+
background_color: color,
|
98
|
+
)
|
99
|
+
object.set_index(@object_index)
|
100
|
+
@objects << object
|
101
|
+
@object_index += 1
|
102
|
+
end
|
103
|
+
|
104
|
+
# Update objects to the virtual screen.
|
85
105
|
def update
|
86
106
|
draw
|
87
|
-
@win.
|
107
|
+
@win.noutrefresh
|
88
108
|
end
|
89
109
|
|
90
110
|
def close
|
data/lib/term_canvas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: term_canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kthatoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -114,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
|
118
|
-
rubygems_version: 2.7.6
|
117
|
+
rubygems_version: 3.1.2
|
119
118
|
signing_key:
|
120
119
|
specification_version: 4
|
121
120
|
summary: Wrapper library for curses of ruby
|