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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 573638c9e0567a5e8dc7dad146e34025de6f3a61083e4520b9e98aff8a2f15f3
4
- data.tar.gz: 862ca4fa81c538cc177c20f1d97e6186230d66329ceb76b2bc66070ea347a12b
3
+ metadata.gz: c1bd363ba44a888981070a4007ba190f3ca763da14f1c8114cf1860d994058a4
4
+ data.tar.gz: ca81ec589f2261c9a8bc1c7cc7d14fe81ce34c95ec9adce3dd0de18b4f7a819e
5
5
  SHA512:
6
- metadata.gz: cb17ffaebea5107df8977a8f993b8a9a8bbe45628fefa9674f869edb463f335460e2aee2caf5b386ec4870e9860216a671aefda98368703720076c8f1ca5b1cf
7
- data.tar.gz: 01c08df812d880c87aabb726799e7c3eaf0e9009f2070ebffa9bf1bb9528cfc481eb829307167d45e2d0bf1c5c06e6cc91735480b16843e2e18db4f4cdc6a3d3
6
+ metadata.gz: d719f57bada3cf8735c37584996606777d0bf31c25b9ce3a1ade260ff7f001dc7d3e38799143ec1d0c5d234aacc4dd4dea30881d9f4aef2b9ca26cd359e2a51f
7
+ data.tar.gz: 4fb2b1076922a5ca1513f6af742e81da81daf8d892eb6a039830d9c0368fc9a10427ff9676327234288f67c9a085073e9c5b0faa51dab695f94dbd18f598b731
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- term_canvas (0.2.9)
4
+ term_canvas (0.2.10)
5
5
  curses
6
6
 
7
7
  GEM
@@ -34,4 +34,4 @@ DEPENDENCIES
34
34
  term_canvas!
35
35
 
36
36
  BUNDLED WITH
37
- 2.0.1
37
+ 2.1.4
@@ -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
- # Display objects that are added into this instance.
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.refresh
107
+ @win.noutrefresh
88
108
  end
89
109
 
90
110
  def close
@@ -1,3 +1,3 @@
1
1
  module TermCanvas
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10"
3
3
  end
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.9
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: 2019-06-24 00:00:00.000000000 Z
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
- rubyforge_project:
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