backgrounds 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +2 -0
- data/Rakefile +2 -2
- data/config/spritesheet-32x32.csv +45 -0
- data/config/spritesheet-32x32.png +0 -0
- data/lib/backgrounds/image.rb +11 -5
- data/lib/backgrounds/version.rb +2 -2
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14d98f76de79e232de2a25cfca5ae7376c8d2649d138fbe9b15a328a119dd979
|
4
|
+
data.tar.gz: 62b22da720a8635701eeec4203f9994c537aef5ccf1a4f5508be5932f279f729
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3c867dc78df7092b8bf50e51b9b101f1a26ac75ed13b463f364e3dd801da2920e237ed5c6316afa8fee02765a8b81a371ff7b5a5e87f31f49bb6bf37fd375d
|
7
|
+
data.tar.gz: 8f6a3d4e1245d215024dd8069a7255c14afdde6eb9cb860dd56332c4b0284b9537fa495f746eea9667a9bbd36f480ebcff6763d504d76934ce46ce9dc7e3066e
|
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -26,8 +26,8 @@ Hoe.spec 'backgrounds' do
|
|
26
26
|
self.history_file = 'CHANGELOG.md'
|
27
27
|
|
28
28
|
self.extra_deps = [
|
29
|
-
['pixelart', '>= 1.3.
|
30
|
-
['spritesheet', '>= 1.0
|
29
|
+
['pixelart', '>= 1.3.2'],
|
30
|
+
['spritesheet', '>= 1.1.0'],
|
31
31
|
]
|
32
32
|
|
33
33
|
self.licenses = ['Public Domain']
|
@@ -0,0 +1,45 @@
|
|
1
|
+
id, category, name, more_names
|
2
|
+
0, , metropolis_1,
|
3
|
+
1, , metropolis_2,
|
4
|
+
2, , codelines,
|
5
|
+
3, , sun,
|
6
|
+
4, , beam,
|
7
|
+
5, , green_tie_dye,
|
8
|
+
6, , orange_tie_dye,
|
9
|
+
7, , purple_tie_dye,
|
10
|
+
8, , yellow_diag,
|
11
|
+
9, , green_diag,
|
12
|
+
10, , blue_diag,
|
13
|
+
11, , pink_diag,
|
14
|
+
12, , yellow_pink_diag,
|
15
|
+
13, , green_black_diag,
|
16
|
+
14, , black_orange_diag,
|
17
|
+
15, , blue_orange_diag,
|
18
|
+
16, , purple_green_diag,
|
19
|
+
17, , purple_orange_diag,
|
20
|
+
18, , green_blue_vert,
|
21
|
+
19, , peach_blue_vert,
|
22
|
+
20, , green_stripe,
|
23
|
+
21, , purple_stripe,
|
24
|
+
22, , candy_stripe,
|
25
|
+
23, , yellow_double_stripe,
|
26
|
+
24, , green_double_stripe,
|
27
|
+
25, , double_yellow,
|
28
|
+
26, , double_green,
|
29
|
+
27, , double_pink,
|
30
|
+
28, , double_purple,
|
31
|
+
29, , triple_green,
|
32
|
+
30, , triple_blue,
|
33
|
+
31, , triple_pink,
|
34
|
+
32, , yellow_solid,
|
35
|
+
33, , green_solid,
|
36
|
+
34, , blue_solid,
|
37
|
+
35, , light_blue_solid,
|
38
|
+
36, , dark_purple_solid,
|
39
|
+
37, , magenta_solid,
|
40
|
+
38, , purple_solid,
|
41
|
+
39, , pink_solid,
|
42
|
+
40, , peach_solid,
|
43
|
+
41, , orange_solid,
|
44
|
+
42, , red_solid,
|
45
|
+
43, , grey_solid,
|
Binary file
|
data/lib/backgrounds/image.rb
CHANGED
@@ -5,7 +5,10 @@ module Background ## note: uses singular Background (no plural s here)
|
|
5
5
|
SPRITESHEETS = {
|
6
6
|
'24x24' => SpriteSheet.read( "#{Pixelart::Module::Backgrounds.root}/config/spritesheet-24x24.png",
|
7
7
|
"#{Pixelart::Module::Backgrounds.root}/config/spritesheet-24x24.csv",
|
8
|
-
width: 24, height: 24 )
|
8
|
+
width: 24, height: 24 ),
|
9
|
+
'32x32' => SpriteSheet.read( "#{Pixelart::Module::Backgrounds.root}/config/spritesheet-32x32.png",
|
10
|
+
"#{Pixelart::Module::Backgrounds.root}/config/spritesheet-32x32.csv",
|
11
|
+
width: 32, height: 32 ),
|
9
12
|
}
|
10
13
|
|
11
14
|
|
@@ -14,7 +17,7 @@ class Image < Pixelart::Image
|
|
14
17
|
width:,
|
15
18
|
height: )
|
16
19
|
|
17
|
-
## check if spritesheet w/ patterns is available for width x height (eg.24x24)
|
20
|
+
## check if spritesheet w/ patterns is available for width x height (eg.24x24, 32x32, etc.)
|
18
21
|
sheet = SPRITESHEETS[ "#{width}x#{height}" ]
|
19
22
|
|
20
23
|
img = new( width, height )
|
@@ -43,14 +46,17 @@ class Image < Pixelart::Image
|
|
43
46
|
|
44
47
|
def self.do_generate( img, value, sheet: )
|
45
48
|
if value.is_a?( String )
|
46
|
-
|
49
|
+
key = Pixelart::Spritesheet.normalize_key( value )
|
50
|
+
if ['ua','ukraine',
|
51
|
+
'saveukraine', 'standwithukraine',
|
52
|
+
'glorytoukraine'].include?( key )
|
47
53
|
img.ukraine
|
48
|
-
elsif ['pride','rainbow'].include?(
|
54
|
+
elsif ['pride','rainbow'].include?( key )
|
49
55
|
img.pride
|
50
56
|
elsif sheet && pattern=sheet.find_by( name: value, warn: false ) ## try some built-in background patterns
|
51
57
|
img.compose!( pattern )
|
52
58
|
img
|
53
|
-
else ### assume color
|
59
|
+
else ### assume (try) color
|
54
60
|
img.compose!( Image.new( img.width, img.height, value ) )
|
55
61
|
img
|
56
62
|
end
|
data/lib/backgrounds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backgrounds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3.
|
19
|
+
version: 1.3.2
|
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: 1.3.
|
26
|
+
version: 1.3.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spritesheet
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0
|
33
|
+
version: 1.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0
|
40
|
+
version: 1.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,8 @@ files:
|
|
89
89
|
- Rakefile
|
90
90
|
- config/spritesheet-24x24.csv
|
91
91
|
- config/spritesheet-24x24.png
|
92
|
+
- config/spritesheet-32x32.csv
|
93
|
+
- config/spritesheet-32x32.png
|
92
94
|
- lib/backgrounds.rb
|
93
95
|
- lib/backgrounds/base.rb
|
94
96
|
- lib/backgrounds/image.rb
|