ruby2d 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,11 +22,9 @@ module Ruby2D
22
22
  @width = opts[:width] || nil
23
23
  @height = opts[:height] || nil
24
24
 
25
- @type_id = 4
26
-
27
25
  self.color = opts[:color] || 'white'
28
26
 
29
- ext_image_init(@path)
27
+ ext_init(@path)
30
28
  add
31
29
  end
32
30
 
@@ -6,8 +6,6 @@ module Ruby2D
6
6
  attr_accessor :x1, :x2, :y1, :y2, :color, :width
7
7
 
8
8
  def initialize(opts = {})
9
- @type_id = 3
10
-
11
9
  @x1 = opts[:x1] || 0
12
10
  @y1 = opts[:y1] || 0
13
11
  @x2 = opts[:x2] || 100
@@ -16,27 +16,27 @@ module Ruby2D
16
16
 
17
17
  @path = path
18
18
  @loop = false
19
- ext_music_init(path)
19
+ ext_init(path)
20
20
  end
21
21
 
22
22
  def play
23
- ext_music_play
23
+ ext_play
24
24
  end
25
25
 
26
26
  def pause
27
- ext_music_pause
27
+ ext_pause
28
28
  end
29
29
 
30
30
  def resume
31
- ext_music_resume
31
+ ext_resume
32
32
  end
33
33
 
34
34
  def stop
35
- ext_music_stop
35
+ ext_stop
36
36
  end
37
37
 
38
38
  def fadeout(ms)
39
- ext_music_fadeout(ms)
39
+ ext_fadeout(ms)
40
40
  end
41
41
  end
42
42
  end
@@ -16,8 +16,6 @@ module Ruby2D
16
16
  attr_reader :color
17
17
 
18
18
  def initialize(opts = {})
19
- @type_id = 2
20
-
21
19
  @x1 = opts[:x1] || 0
22
20
  @y1 = opts[:y1] || 0
23
21
  @x2 = opts[:x2] || 100
@@ -6,8 +6,6 @@ module Ruby2D
6
6
  attr_reader :x, :y, :width, :height
7
7
 
8
8
  def initialize(opts = {})
9
- @type_id = 2
10
-
11
9
  @x = opts[:x] || 0
12
10
  @y = opts[:y] || 0
13
11
  @z = opts[:z] || 0
@@ -15,11 +15,11 @@ module Ruby2D
15
15
  end
16
16
 
17
17
  @path = path
18
- ext_sound_init(path)
18
+ ext_init(path)
19
19
  end
20
20
 
21
21
  def play
22
- ext_sound_play
22
+ ext_play
23
23
  end
24
24
 
25
25
  end
@@ -12,7 +12,6 @@ module Ruby2D
12
12
  # raise Error, "Cannot find image file `#{path}`"
13
13
  # end
14
14
 
15
- @type_id = 5
16
15
  @x, @y, @path = x, y, path
17
16
  @clip_x, @clip_y, @clip_w, @clip_h = 0, 0, 0, 0
18
17
  @default = nil
@@ -22,7 +21,7 @@ module Ruby2D
22
21
  @current_frame_time = 0
23
22
  @z = z
24
23
 
25
- ext_sprite_init(path)
24
+ ext_init(path)
26
25
  if Module.const_defined? :DSL
27
26
  Application.add(self)
28
27
  end
@@ -6,7 +6,6 @@ module Ruby2D
6
6
  attr_reader :size
7
7
 
8
8
  def initialize(opts = {})
9
- @type_id = 2
10
9
  @x = opts[:x] || 0
11
10
  @y = opts[:y] || 0
12
11
  @z = opts[:z] || 0
@@ -8,8 +8,6 @@ module Ruby2D
8
8
  attr_reader :text, :size, :width, :height, :font, :color
9
9
 
10
10
  def initialize(opts = {})
11
- @type_id = 6
12
-
13
11
  @x = opts[:x] || 0
14
12
  @y = opts[:y] || 0
15
13
  @z = opts[:z] || 0
@@ -25,13 +23,13 @@ module Ruby2D
25
23
  end
26
24
 
27
25
  self.color = opts[:color] || 'white'
28
- ext_text_init
26
+ ext_init
29
27
  add
30
28
  end
31
29
 
32
30
  def text=(msg)
33
31
  @text = msg.to_s
34
- ext_text_set(@text)
32
+ ext_set(@text)
35
33
  end
36
34
 
37
35
  def color=(c)
@@ -10,8 +10,6 @@ module Ruby2D
10
10
  attr_reader :color, :type_id
11
11
 
12
12
  def initialize(opts= {})
13
- @type_id = 1
14
-
15
13
  @x1 = opts[:x1] || 50
16
14
  @y1 = opts[:y1] || 0
17
15
  @x2 = opts[:x2] || 100
@@ -1,5 +1,5 @@
1
1
  # version.rb
2
2
 
3
3
  module Ruby2D
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
@@ -228,11 +228,11 @@ module Ruby2D
228
228
  end
229
229
 
230
230
  def show
231
- ext_window_show
231
+ ext_show
232
232
  end
233
233
 
234
234
  def close
235
- ext_window_close
235
+ ext_close
236
236
  end
237
237
 
238
238
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Black
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2017-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.6.12
96
+ rubygems_version: 2.6.13
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Ruby 2D