gosu_enhanced 0.3.5 → 0.4.0

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
  SHA1:
3
- metadata.gz: 3a951985d3479c4c6c784582a6c62d89033d20a0
4
- data.tar.gz: 6abef53400b8d8994e1e43ff69af8e1ceaf0fb6c
3
+ metadata.gz: c4a6e89af5f71916d83458e666a86556fccdc505
4
+ data.tar.gz: 141b89e794b09c16dc91be1c07d8f2ad84dcdc58
5
5
  SHA512:
6
- metadata.gz: ef111cb6f34b22de480995f567721e1ca7468d7daab013947376f6aff09e6722c3e4c4ae250e601991751a9fef17474151d06897e2621653539e94a6e5722891
7
- data.tar.gz: 30aeb5557b13a7321fcd87f39b7ab06555103fe372f8cd5b9415a233ff676070f76758d6c3dfaeb92ae47ad0130a3a38e6641a173a2a1167bd14eef077129ff2
6
+ metadata.gz: bc4c445e86b7fb00f88f00887cd0a4f4c2c8fb31a508d166719194386ab0aae2b4fac2d908947fa6c17f71521152f25fd887e93ca073d74275a37abafac7abd2
7
+ data.tar.gz: 2ab6d7d7ba444696c8a02ce2ba5c6b6fe275d1810f9344cfe53154704575e4f882e4086a1a29d12450750fb8d65f0829299ed0d852e57b5896e92a4c30fad91c
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Julian Nicholls']
10
10
  spec.email = ['juliannicholls29@gmail.com']
11
11
  spec.summary = 'Enhanced versions of some Gosu classes.'
12
- spec.description = %(Point, Size, and Region classes to hold pixel addresses
12
+ spec.description = %(Point, Size, and Region classes to hold pixel co-ordinatess
13
13
  and rectangle sizes respectively.
14
- Updated window class to draw rectangle in a single colour more easily.
14
+ Updated window class to draw rectangles and lines in a single colour more easily.
15
15
  Updated font class to measure text and return co-ordinates to centre a piece
16
16
  of text in a rectangle size.)
17
17
  spec.homepage = 'https://github.com/JulianNicholls/gosu_enhanced-gem'
@@ -24,6 +24,20 @@ module Gosu
24
24
  left, top + height, colour,
25
25
  z_index)
26
26
  end
27
+
28
+ # Simplify drawing a line.
29
+ #
30
+ # There are dire warnings in the Gosu documentation for draw_line() which
31
+ # suggest that line drawing should only be done for debugging purposes.
32
+ #
33
+ # +p1+ [Point] Beginning point
34
+ # +p2+ [Point] Endpoint
35
+ # +z_index+ [Fixnum] Z-order
36
+ # +colour+ [Gosu::Color] Colour of line
37
+
38
+ def draw_simple_line(p1, p2, z_index, colour)
39
+ draw_line(p1.x, p1.y, colour, p2.x, p2.y, colour, z_index)
40
+ end
27
41
  end
28
42
 
29
43
  # Add a measure to return both width and height for a text and a way
@@ -59,6 +73,11 @@ module Gosu
59
73
  )
60
74
  end
61
75
 
76
+ # Synonym for centred_in, allowing for centre to be spelled center.
77
+ #
78
+ # +text+ [String] String to centre
79
+ # +rect+ [Size] Rectangular area size
80
+
62
81
  alias_method :centered_in, :centred_in
63
82
  end
64
83
  end
@@ -50,4 +50,14 @@ module GosuEnhanced
50
50
  self
51
51
  end
52
52
  end
53
+
54
+ # Utility function to construct a Point
55
+ #
56
+ # +x+ x co-ordinate
57
+ # +y+ y co-ordinate
58
+
59
+ def Point(x, y)
60
+ Point.new(x, y)
61
+ end
53
62
  end
63
+
@@ -34,7 +34,7 @@ module GosuEnhanced
34
34
  position.y
35
35
  end
36
36
 
37
- # Return the leftmost co-oridinate
37
+ # Return the leftmost co-ordinate
38
38
  def left
39
39
  position.x
40
40
  end
@@ -100,4 +100,13 @@ module GosuEnhanced
100
100
  self
101
101
  end
102
102
  end
103
+
104
+ # Utility function to construct a size
105
+ #
106
+ # +x+ Width
107
+ # +y+ Height
108
+
109
+ def Size(x, y)
110
+ Size.new(x, y)
111
+ end
103
112
  end
@@ -1,5 +1,5 @@
1
1
  # Version of the gosu_enhanced gem.
2
2
  module GosuEnhanced
3
3
  # gosu_enhanced gem version
4
- VERSION = '0.3.5'
4
+ VERSION = '0.4.0'
5
5
  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.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Nicholls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-22 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
@@ -95,9 +95,9 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.10'
97
97
  description: |-
98
- Point, Size, and Region classes to hold pixel addresses
98
+ Point, Size, and Region classes to hold pixel co-ordinatess
99
99
  and rectangle sizes respectively.
100
- Updated window class to draw rectangle in a single colour more easily.
100
+ Updated window class to draw rectangles and lines in a single colour more easily.
101
101
  Updated font class to measure text and return co-ordinates to centre a piece
102
102
  of text in a rectangle size.
103
103
  email: