gosu_enhanced 0.3.3 → 0.3.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0dc6fb4cc8601ab21b00c0d32b1f15c164e11286
4
- data.tar.gz: 1eeb8f44e773cfeee38f073071816e50f6cd462d
3
+ metadata.gz: fdfb20c8fb5079f40adf28f07762babe6a844f1c
4
+ data.tar.gz: 6dd6cfd4a944a7e1888c423d878c7fd4835c67e6
5
5
  SHA512:
6
- metadata.gz: 5abb6c36d7f637e360a6264fa7b570f0c29e650a378e32279d03d6c5cfedf168dcdfe79d7231c7684d8abc10784111729f0c14287ba531a0d57fd057bc64f76b
7
- data.tar.gz: cbbc81526079ec291068f354bd01f816d5af62d4678a3e210cfecc18320491bcb2c5c07558cd5e5f04e862ddb70295bb363faf058b6912b1fca8d3debeeb2831
6
+ metadata.gz: e27f8d50b970ee5a7b9b41b6ecb76fa1da3597cbcfb10df3af0d44c8b9a7fcb4840061b828a92fefc5a26291132680fc2ddb71e03a6e5da6a2c0798e54d6333f
7
+ data.tar.gz: 35804c2dac06b6b21ebd527c1617c16e626003c9b622063f46a7dca4eb9de003010c2aaaecb064d649618f8def62ad4c4f72156999c4bdf140b5c39d30536a0d
data/README.md CHANGED
@@ -47,7 +47,7 @@ Or install it yourself as:
47
47
 
48
48
  ## Contributing
49
49
 
50
- 1. Fork it ( https://github.com/[my-github-username]/gosu_enhanced/fork )
50
+ 1. Fork it ( https://github.com/JulianNicholls/gosu_enhanced/fork )
51
51
  2. Create your feature branch (`git checkout -b my-new-feature`)
52
52
  3. Commit your changes (`git commit -am 'Add some feature'`)
53
53
  4. Push to the branch (`git push origin my-new-feature`)
@@ -22,7 +22,7 @@ of text in a rectangle size.}
22
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_runtime_dependency "gosu", "~> 0.7"
25
+ spec.add_runtime_dependency "gosu", "~> 0.9"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.6"
28
28
  spec.add_development_dependency "rake", "~> 0.9"
@@ -1,7 +1,16 @@
1
+ # Gosu is the module that the Gosu library uses. It is re-opened here to allow
2
+ # access to the Window and Font classes.
1
3
  module Gosu
2
4
  # Add a draw_rectangle() to Window which simplifies drawing a simple rectangle
3
5
  # in one colour
4
6
  class Window
7
+ # Simplify drawing a rectangle in a single colour.
8
+ #
9
+ # @param point [Point] Top left corner
10
+ # @param size [Size] Width and Height
11
+ # @param z_index [Fixnum] Z-order
12
+ # @param colour [Gosu::Color] Colour of rectangle
13
+
5
14
  def draw_rectangle( point, size, z_index, colour )
6
15
  left, top = point.x, point.y
7
16
  width, height = size.width, size.height
@@ -17,14 +26,28 @@ module Gosu
17
26
  end
18
27
 
19
28
  # Add a measure to return both width and height for a text and a way
20
- # to centre a text in a rectangle
29
+ # to centre a text in a rectangle.
21
30
  class Font
22
31
  include GosuEnhanced
23
32
 
33
+ # Return the width and height of a given string
34
+ #
35
+ # @param text [String] String to measure
36
+ #
37
+ # @return [Size] The height and width of the string.
38
+
24
39
  def measure( text )
25
40
  Size.new( text_width( text, 1 ), height )
26
41
  end
27
42
 
43
+ # Return the co-ordnates needed to place a given string in the centre of an
44
+ # area, both vertically and horizontally
45
+ #
46
+ # @param text [String] String to centre
47
+ # @param rect [Size] Rectangular area size
48
+ #
49
+ # @return [Point] The point to write the string, expressed as an offset from the top-left corner of the rectangle.
50
+
28
51
  def centred_in( text, rect )
29
52
  size = measure( text )
30
53
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  module GosuEnhanced
3
- VERSION = '0.3.3'
3
+ VERSION = '0.3.4'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu_enhanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Nicholls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-10 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
26
+ version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.2.2
147
+ rubygems_version: 2.4.7
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Enhanced versions of some Gosu classes.
@@ -154,4 +154,3 @@ test_files:
154
154
  - spec/region_spec.rb
155
155
  - spec/size_spec.rb
156
156
  - spec/spec_helper.rb
157
- has_rdoc: