rgss3 0.1.0 → 0.1.1

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.
@@ -0,0 +1,69 @@
1
+ class Tone
2
+
3
+ attr_reader :red, :green, :blue, :gray
4
+
5
+ def initialize(*args)
6
+ case args.size
7
+ when 0
8
+ set(0, 0, 0, 0)
9
+ when 3
10
+ args << 0
11
+ set(*args)
12
+ when 4
13
+ set(*args)
14
+ else
15
+ raise ArgumentError
16
+ end
17
+ end
18
+
19
+ def set(*args)
20
+ case args.size
21
+ when 1
22
+ if args[0].is_a?(Tone)
23
+ set(*args[0].to_a)
24
+ else
25
+ raise ArgumentError
26
+ end
27
+ when 3
28
+ args << 0
29
+ set(*args)
30
+ when 4
31
+ self.red = args[0]
32
+ self.green = args[1]
33
+ self.blue = args[2]
34
+ self.gray = args[3]
35
+ else
36
+ raise ArgumentError
37
+ end
38
+ end
39
+
40
+ def red=(int)
41
+ @red = [[255, int].min, -255].max.to_f
42
+ end
43
+
44
+ def green=(int)
45
+ @green = [[255, int].min, -255].max.to_f
46
+ end
47
+
48
+ def blue=(int)
49
+ @blue = [[255, int].min, -255].max.to_f
50
+ end
51
+
52
+ def gray=(int)
53
+ @gray = [[255, int].min, 0].max.to_f
54
+ end
55
+
56
+ def _dump(d = 0)
57
+ [@red, @green, @blue, @gray].pack('d4')
58
+ end
59
+
60
+ def self._load(s)
61
+ Tone.new(*s.unpack('d4'))
62
+ end
63
+
64
+ # NEW
65
+
66
+ def to_a
67
+ [red, green, blue, gray]
68
+ end
69
+ end
@@ -1,3 +1,3 @@
1
1
  module RGSS3
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,43 @@
1
+ class Viewport
2
+
3
+ attr_accessor :color, :tone, :rect, :visible, :z, :ox, :oy
4
+
5
+ def initialize(*args)
6
+ case args.size
7
+ when 0
8
+ @rect = Rect.new(0, 0, Graphics.width, Graphics.height)
9
+ when 1
10
+ if args[0].is_a?(Rect)
11
+ @rect = args[0]
12
+ else
13
+ raise ArgumentError
14
+ end
15
+ when 4
16
+ @rect = Rect.new(*args)
17
+ else
18
+ raise ArgumentError
19
+ end
20
+ @visible = true
21
+ @z = 0
22
+ @ox = 0
23
+ @oy = 0
24
+ end
25
+
26
+ def dispose
27
+ @disposed = true
28
+ end
29
+
30
+ def disposed?
31
+ @disposed
32
+ end
33
+
34
+ def flash(color, duration)
35
+ @flash_color = color || Color.new(0, 0, 0, 0)
36
+ @flash_duration = duration
37
+ end
38
+
39
+ def update
40
+ @flash_duration = [@flash_duration - 1, 0].max
41
+ @flash_color = nil if @flash_duration == 0
42
+ end
43
+ end
@@ -0,0 +1,58 @@
1
+ require_relative 'container'
2
+ class Window
3
+
4
+ include RGSS3::Container
5
+
6
+ attr_accessor :windowskin
7
+ attr_accessor :contents
8
+ attr_accessor :cursor_rect
9
+ attr_accessor :active
10
+ attr_accessor :visible
11
+ attr_accessor :arrows_visible
12
+ attr_accessor :pause
13
+ attr_accessor :x
14
+ attr_accessor :y
15
+ attr_accessor :width
16
+ attr_accessor :height
17
+ attr_accessor :padding
18
+ attr_accessor :padding_bottom
19
+ attr_accessor :opacity
20
+ attr_accessor :back_opacity
21
+ attr_accessor :contents_opacity
22
+ attr_accessor :openness
23
+
24
+ def initialize(*args)
25
+ case args.size
26
+ when 0
27
+ @x = 0
28
+ @y = 0
29
+ @width = 0
30
+ @height = 0
31
+ when 4
32
+ @x, @y, @width, @height = args
33
+ end
34
+ super()
35
+ end
36
+
37
+ def update
38
+ end
39
+
40
+ def move(x, y, width, height)
41
+ @x = x
42
+ @y = y
43
+ @width = width
44
+ @height = height
45
+ end
46
+
47
+ def open?
48
+ openness == 255
49
+ end
50
+
51
+ def close?
52
+ openness == 0
53
+ end
54
+
55
+ def draw
56
+ # TODO
57
+ end
58
+ end
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "bundler", "~> 1.14"
36
36
  spec.add_development_dependency "rake", "~> 10.0"
37
37
 
38
- spec.requirements << 'ImageMagick 6, Q8 recommended'
38
+ spec.requirements << 'Q8 versions of ImageMagick 6 is recommended'
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgss3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - taroxd
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-11 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
@@ -81,7 +81,29 @@ files:
81
81
  - bin/console
82
82
  - bin/setup
83
83
  - lib/rgss3.rb
84
+ - lib/rgss3/audio.rb
85
+ - lib/rgss3/bitmap.rb
86
+ - lib/rgss3/color.rb
87
+ - lib/rgss3/container.rb
88
+ - lib/rgss3/font.rb
89
+ - lib/rgss3/game_window.rb
90
+ - lib/rgss3/graphics.rb
91
+ - lib/rgss3/input.rb
92
+ - lib/rgss3/kernel_ext.rb
93
+ - lib/rgss3/plane.rb
94
+ - lib/rgss3/rect.rb
95
+ - lib/rgss3/rgss3a.rb
96
+ - lib/rgss3/rgss_error.rb
97
+ - lib/rgss3/rgss_reset.rb
98
+ - lib/rgss3/rpg.rb
99
+ - lib/rgss3/sprite.rb
100
+ - lib/rgss3/sprite_container.rb
101
+ - lib/rgss3/table.rb
102
+ - lib/rgss3/tilemap.rb
103
+ - lib/rgss3/tone.rb
84
104
  - lib/rgss3/version.rb
105
+ - lib/rgss3/viewport.rb
106
+ - lib/rgss3/window.rb
85
107
  - rgss3.gemspec
86
108
  homepage: https://github.com/taroxd/RGSS3
87
109
  licenses:
@@ -102,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
124
  - !ruby/object:Gem::Version
103
125
  version: '0'
104
126
  requirements:
105
- - ImageMagick 6, Q8 recommended
127
+ - Q8 versions of ImageMagick 6 is recommended
106
128
  rubyforge_project:
107
129
  rubygems_version: 2.6.12
108
130
  signing_key: