gosu_enhanced 0.3.5 → 0.4.0
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 +4 -4
- data/gosu_enhanced.gemspec +2 -2
- data/lib/gosu_enhanced/enhanced.rb +19 -0
- data/lib/gosu_enhanced/point.rb +10 -0
- data/lib/gosu_enhanced/region.rb +1 -1
- data/lib/gosu_enhanced/size.rb +9 -0
- data/lib/gosu_enhanced/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4a6e89af5f71916d83458e666a86556fccdc505
|
4
|
+
data.tar.gz: 141b89e794b09c16dc91be1c07d8f2ad84dcdc58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc4c445e86b7fb00f88f00887cd0a4f4c2c8fb31a508d166719194386ab0aae2b4fac2d908947fa6c17f71521152f25fd887e93ca073d74275a37abafac7abd2
|
7
|
+
data.tar.gz: 2ab6d7d7ba444696c8a02ce2ba5c6b6fe275d1810f9344cfe53154704575e4f882e4086a1a29d12450750fb8d65f0829299ed0d852e57b5896e92a4c30fad91c
|
data/gosu_enhanced.gemspec
CHANGED
@@ -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
|
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
|
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
|
data/lib/gosu_enhanced/point.rb
CHANGED
data/lib/gosu_enhanced/region.rb
CHANGED
data/lib/gosu_enhanced/size.rb
CHANGED
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.
|
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-
|
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
|
98
|
+
Point, Size, and Region classes to hold pixel co-ordinatess
|
99
99
|
and rectangle sizes respectively.
|
100
|
-
Updated window class to draw
|
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:
|