goblins 0.0.1 → 1.0.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/Manifest.txt +4 -0
- data/README.md +116 -6
- data/Rakefile +4 -4
- data/config/spritesheet-20x20.csv +35 -0
- data/config/spritesheet-20x20.png +0 -0
- data/config/spritesheet-24x24.csv +52 -0
- data/config/spritesheet-24x24.png +0 -0
- data/lib/goblins/version.rb +6 -4
- data/lib/goblins.rb +67 -28
- metadata +16 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc5f809aece1ae4f64d98c4a4ccce5375107ca8729b9f2d294da5d83a1e3f028
|
4
|
+
data.tar.gz: d66b90e96129a852751544cdc7d3b2c0dfc94916eaff501cf7f925c8428619f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eecd66a046b4ef91f2eaaa92a80f4e78974a266123e9ece164cd3cf5a71d8f575b609ed405fbb11675e83c2f6f8fc4144a81ba559df83561dc764dce6ab30e5b
|
7
|
+
data.tar.gz: 457b7b2c1845eff2a7b30dc09ac5ad05cf845e54e9308c764f3d5babc30bad0101cfded8b2172bdbbe204de77f9b4df5f2e88b92bb771964747200aa17263bf2
|
data/Manifest.txt
CHANGED
data/README.md
CHANGED
@@ -1,25 +1,135 @@
|
|
1
|
-
|
1
|
+
The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/profilepic/originals) Presents
|
2
2
|
|
3
|
-
goblins - generate your own 20×20 goblins (pixel avatars) images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
|
4
3
|
|
4
|
+
# Goblins & Lil' Goblins (Pixel Monster Avatars)
|
5
5
|
|
6
|
+
Yes, you can! Generate your own 24×24 goblins or 20×20 lil' goblins (pixel) monster avatars images (off-blockchain) from text attributes (via built-in spritesheets); incl. 2x/4x/8x zoom for bigger sizes and more
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
|
9
|
+
|
10
|
+
* home :: [github.com/profilepic/text-to-image](https://github.com/profilepic/text-to-image)
|
11
|
+
* bugs :: [github.com/profilepic/text-to-image/issues](https://github.com/profilepic/text-to-image/issues)
|
9
12
|
* gem :: [rubygems.org/gems/goblins](https://rubygems.org/gems/goblins)
|
10
13
|
* rdoc :: [rubydoc.info/gems/goblins](http://rubydoc.info/gems/goblins)
|
11
14
|
|
12
15
|
|
13
16
|
|
14
17
|
|
18
|
+
|
15
19
|
## Usage
|
16
20
|
|
17
21
|
Let's generate some super-rare never-before-seen
|
18
|
-
|
22
|
+
goblin monster (pixel) avatars (24x24):
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'goblins'
|
26
|
+
|
27
|
+
goblin = Goblin::Image.generate( 'Green', 'Teeth',
|
28
|
+
'3D Glasses', 'Blue Sweater' )
|
29
|
+
goblin.save( "goblin1.png")
|
30
|
+
goblin.zoom(4).save( "goblin1@4x.png" )
|
31
|
+
|
32
|
+
|
33
|
+
goblin = Goblin::Image.generate( 'Gold 2', 'Eyes', 'Frown',
|
34
|
+
'Horns', 'Suit Open' )
|
35
|
+
goblin.save( "goblin2.png")
|
36
|
+
goblin.zoom(4).save( "goblin2@4x.png" )
|
37
|
+
|
38
|
+
|
39
|
+
goblin = Goblin::Image.generate( 'Blue', 'Eyes', 'Smile',
|
40
|
+
'Hoodie', 'Bow', 'Bojangles' )
|
41
|
+
goblin.save( "goblin3.png")
|
42
|
+
goblin.zoom(4).save( "goblin3@4x.png" )
|
43
|
+
```
|
44
|
+
|
45
|
+
Voila!
|
46
|
+
|
47
|
+

|
48
|
+

|
49
|
+

|
50
|
+
|
51
|
+
In 4x:
|
52
|
+
|
53
|
+

|
54
|
+

|
55
|
+

|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
Let's try some lil' goblins (20x20):
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
lilgoblin = LilGoblin::Image.generate( 'Green', 'Orange Beanie',
|
64
|
+
'Earring Silver', 'Blue Sweater' )
|
65
|
+
lilgoblin.save( "lilgoblin1.png")
|
66
|
+
lilgoblin.zoom(4).save( "lilgoblin1@4x.png" )
|
67
|
+
|
68
|
+
|
69
|
+
lilgoblin = LilGoblin::Image.generate( 'Gold', 'Cool Shades',
|
70
|
+
'Horns', 'Suit Open' )
|
71
|
+
lilgoblin.save( "lilgoblin2.png")
|
72
|
+
lilgoblin.zoom(4).save( "lilgoblin2@4x.png" )
|
73
|
+
|
74
|
+
|
75
|
+
lilgoblin = LilGoblin::Image.generate( 'Red', 'Chef',
|
76
|
+
'Orange Shades', 'Hoodie', 'Earring Gold' )
|
77
|
+
lilgoblin.save( "lilgoblin3.png")
|
78
|
+
lilgoblin.zoom(4).save( "lilgoblin3@4x.png" )
|
79
|
+
```
|
80
|
+
|
81
|
+
Voila!
|
82
|
+
|
83
|
+

|
84
|
+

|
85
|
+

|
86
|
+
|
87
|
+
In 4x:
|
88
|
+
|
89
|
+

|
90
|
+

|
91
|
+

|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
## Bonus - Ugly, Uglier, Ugliest - Yes, You Can - Design Your Own Goblin (Pixel) Monsters - Original 1/1 Goblin Monster Starter Kit
|
96
|
+
|
97
|
+
Is ugly the new beau / belle? Yes, you can. Design your own goblin (pixel) monsters.
|
98
|
+
|
99
|
+
|
100
|
+

|
101
|
+
|
102
|
+
To get you started find a series of original 1/1 goblin monsters (see above in 4x zoom) and a script to (auto-)generate some variants (with horns, cap forward, hoodies, golden earrings, & more) in the [goblins/sandbox »](https://github.com/profilepic/text-to-image/tree/master/goblins/sandbox)
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
## Appendix - All Built-In Spritesheet Attributes
|
110
|
+
|
111
|
+
**Goblins (24x24px)**
|
112
|
+
|
113
|
+
See the [spritesheet-24x24.csv](https://github.com/profilepic/text-to-image/blob/master/goblins/config/spritesheet-24x24.csv) dataset for all attribute names (w/ categories).
|
114
|
+
|
115
|
+

|
116
|
+
|
117
|
+
(Source: [goblins/spritesheet-24x24.png](https://github.com/profilepic/text-to-image/blob/master/goblins/config/spritesheet-24x24.png))
|
118
|
+
|
119
|
+
|
120
|
+
**Lil' Goblins (20x20px)**
|
121
|
+
|
122
|
+
|
123
|
+
See the [spritesheet-20x20.csv](https://github.com/profilepic/text-to-image/blob/master/goblins/config/spritesheet-20x20.csv) dataset for all attribute names (w/ categories).
|
124
|
+
|
125
|
+

|
126
|
+
|
127
|
+
(Source: [goblins/spritesheet-20x20.png](https://github.com/profilepic/text-to-image/blob/master/goblins/config/spritesheet-20x20.png))
|
19
128
|
|
20
129
|
|
21
130
|
|
22
131
|
|
23
132
|
## Questions? Comments?
|
24
133
|
|
25
|
-
Post them on the [
|
134
|
+
Post them on the [D.I.Y. Punk (Pixel) Art reddit](https://old.reddit.com/r/DIYPunkArt). Thanks.
|
135
|
+
|
data/Rakefile
CHANGED
@@ -11,12 +11,12 @@ end
|
|
11
11
|
|
12
12
|
Hoe.spec 'goblins' do
|
13
13
|
|
14
|
-
self.version = Goblins::VERSION
|
14
|
+
self.version = Pixelart::Module::Goblins::VERSION
|
15
15
|
|
16
|
-
self.summary = "goblins - generate your own 20×20
|
16
|
+
self.summary = "goblins - generate your own 24×24 goblins or 20×20 lil'goblins (pixel) monster avatar images (off-blockchain) from text attributes (via built-in spritesheets); incl. 2x/4x/8x zoom for bigger sizes and more"
|
17
17
|
self.description = summary
|
18
18
|
|
19
|
-
self.urls = { home: 'https://github.com/
|
19
|
+
self.urls = { home: 'https://github.com/profilepic/text-to-image' }
|
20
20
|
|
21
21
|
self.author = 'Gerald Bauer'
|
22
22
|
self.email = 'wwwmake@googlegroups.com'
|
@@ -26,7 +26,7 @@ Hoe.spec 'goblins' do
|
|
26
26
|
self.history_file = 'CHANGELOG.md'
|
27
27
|
|
28
28
|
self.extra_deps = [
|
29
|
-
['
|
29
|
+
['artfactory', '>= 0.2.0'],
|
30
30
|
]
|
31
31
|
|
32
32
|
self.licenses = ['Public Domain']
|
@@ -0,0 +1,35 @@
|
|
1
|
+
id, category, name, more_names
|
2
|
+
0, , green,
|
3
|
+
1, , brown,
|
4
|
+
2, , gray,
|
5
|
+
3, , red,
|
6
|
+
4, , gold,
|
7
|
+
5, , bojangles,
|
8
|
+
6, , Earring Gold,
|
9
|
+
7, , Earrings Double Gold,
|
10
|
+
8, , Earring Silver,
|
11
|
+
9, , Earrings Double Silver,
|
12
|
+
10, , black_shades,
|
13
|
+
11, , blue_shades,
|
14
|
+
12, , orange_shades,
|
15
|
+
13, , cool_shades,
|
16
|
+
14, , blue_flipped_cap,
|
17
|
+
15, , red_flipped_cap,
|
18
|
+
16, , Charcoal Flipped Cap, Flipped Cap
|
19
|
+
17, , chef,
|
20
|
+
18, , halo,
|
21
|
+
19, , horns,
|
22
|
+
20, , orange_beanie,
|
23
|
+
21, , red_beanie,
|
24
|
+
22, , straw_hat,
|
25
|
+
23, , blue_hoodie,
|
26
|
+
24, , hoodie,
|
27
|
+
25, , blue_shirt,
|
28
|
+
26, , white_shirt,
|
29
|
+
27, , green_shirt,
|
30
|
+
28, , blue_sweater,
|
31
|
+
29, , white_sweater,
|
32
|
+
30, , white_turtleneck,
|
33
|
+
31, , suit-blue_tie,
|
34
|
+
32, , suit-open,
|
35
|
+
33, , suit-purple_tie,
|
Binary file
|
@@ -0,0 +1,52 @@
|
|
1
|
+
id, category, name, more_names
|
2
|
+
0, , Green 1, Green
|
3
|
+
1, , green2,
|
4
|
+
2, , Brown 1, Brown
|
5
|
+
3, , brown2,
|
6
|
+
4, , Gray 1, Gray
|
7
|
+
5, , gray2,
|
8
|
+
6, , Blue 1, Blue
|
9
|
+
7, , blue2,
|
10
|
+
8, , Red 1, Red
|
11
|
+
9, , red1i,
|
12
|
+
10, , red1ii,
|
13
|
+
11, , red2,
|
14
|
+
12, , red2i,
|
15
|
+
13, , red2ii,
|
16
|
+
14, , red3,
|
17
|
+
15, , Gold 1, Gold | Golden 1 | Golden
|
18
|
+
16, , Gold 2, Golden 2
|
19
|
+
17, , Eyes,
|
20
|
+
18, , Mouth 1, Teeth | Mouth w/ Teeth
|
21
|
+
19, , Mouth 2, Mouth
|
22
|
+
20, , Mouth 3, Smile
|
23
|
+
21, , Mouth 4, Frown
|
24
|
+
22, , 3d_glasses,
|
25
|
+
23, , big_shades,
|
26
|
+
24, , heart_shades,
|
27
|
+
25, , regular_shades,
|
28
|
+
26, , Bojangles 1, Bojangles
|
29
|
+
27, , bojangles2,
|
30
|
+
28, , Earring Gold 1, Earring Gold
|
31
|
+
29, , Earring Gold 2,
|
32
|
+
30, , Earrings Double Gold 1, Earrings Double Gold
|
33
|
+
31, , Earrings Double Gold 2,
|
34
|
+
32, , beanie,
|
35
|
+
33, , bow,
|
36
|
+
34, , cap,
|
37
|
+
35, , cap_forward,
|
38
|
+
36, , horns,
|
39
|
+
37, , knitted_cap,
|
40
|
+
38, , top_hat,
|
41
|
+
39, , pipe,
|
42
|
+
40, , blue_hoodie,
|
43
|
+
41, , blue_shirt,
|
44
|
+
42, , blue_sweater,
|
45
|
+
43, , green_shirt,
|
46
|
+
44, , hoodie,
|
47
|
+
45, , suit-blue_tie,
|
48
|
+
46, , suit-open,
|
49
|
+
47, , suit-purple_tie,
|
50
|
+
48, , white_shirt,
|
51
|
+
49, , white_sweater,
|
52
|
+
50, , white_turtleneck,
|
Binary file
|
data/lib/goblins/version.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
module Pixelart
|
3
|
+
module Module
|
3
4
|
module Goblins
|
4
5
|
|
5
|
-
MAJOR =
|
6
|
+
MAJOR = 1
|
6
7
|
MINOR = 0
|
7
|
-
PATCH =
|
8
|
+
PATCH = 0
|
8
9
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
9
10
|
|
10
11
|
def self.version
|
@@ -19,5 +20,6 @@ module Goblins
|
|
19
20
|
File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
|
20
21
|
end
|
21
22
|
|
23
|
+
end # module Pixelart
|
24
|
+
end # module Module
|
22
25
|
end # module Goblins
|
23
|
-
|
data/lib/goblins.rb
CHANGED
@@ -1,57 +1,96 @@
|
|
1
|
-
## 3rd party
|
2
|
-
require '
|
1
|
+
## our own "3rd" party gems
|
2
|
+
require 'artfactory/base'
|
3
3
|
|
4
4
|
|
5
5
|
|
6
6
|
## our own code
|
7
|
-
|
7
|
+
require_relative 'goblins/version' # note: let version always go first
|
8
8
|
|
9
9
|
|
10
|
-
## forward define superclass for image
|
11
|
-
module Goblins
|
12
|
-
class Image < Pixelart::Image; end
|
13
|
-
end
|
14
10
|
|
15
|
-
|
16
|
-
## add convenience pre-configurated generatored with build-in spritesheet (see config)
|
11
|
+
module Goblin
|
17
12
|
|
18
|
-
|
13
|
+
class Spritesheet
|
14
|
+
def self.builtin
|
15
|
+
@builtin ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Goblins.root}/config/spritesheet-24x24.png",
|
16
|
+
"#{Pixelart::Module::Goblins.root}/config/spritesheet-24x24.csv",
|
17
|
+
width: 24,
|
18
|
+
height: 24 )
|
19
|
+
end
|
20
|
+
## note: for now class used for "namespace" only
|
21
|
+
def self.find_by( name: ) ## return archetype/attribute image by name
|
22
|
+
builtin.find_by( name: name )
|
23
|
+
end
|
24
|
+
end # class Spritesheet
|
25
|
+
## add convenience (alternate spelling) alias - why? why not?
|
26
|
+
SpriteSheet = Spritesheet
|
27
|
+
Sheet = Spritesheet
|
28
|
+
Sprite = Spritesheet
|
29
|
+
|
30
|
+
|
31
|
+
class Image < Pixelart::Image
|
32
|
+
|
33
|
+
def self.generator
|
34
|
+
@generator ||= Artfactory.use( Goblin::Sheet.builtin,
|
35
|
+
image_class: Image )
|
36
|
+
end
|
19
37
|
|
20
|
-
|
21
|
-
@generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
|
22
|
-
"#{root}/config/spritesheet.csv",
|
23
|
-
width: 20,
|
24
|
-
height: 20 )
|
25
|
-
end
|
38
|
+
NAMES = ['goblin', 'goblins', 'goblinz']
|
26
39
|
|
40
|
+
DEFAULT_ATTRIBUTES = ['Green', 'Teeth',
|
41
|
+
'3D Glasses', 'Blue Sweater']
|
27
42
|
|
28
|
-
|
29
|
-
|
30
|
-
img = Goblins.generator.generate( *values, background: background )
|
31
|
-
## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
|
32
|
-
new( 20, 20, img.image )
|
43
|
+
def self.generate( *names )
|
44
|
+
generator.generate( *names )
|
33
45
|
end # method Image.generate
|
34
46
|
end # class Image
|
47
|
+
end # module Goblin
|
35
48
|
|
36
49
|
|
50
|
+
|
51
|
+
|
52
|
+
module Lilgoblin
|
53
|
+
|
37
54
|
class Spritesheet
|
55
|
+
def self.builtin
|
56
|
+
@builtin ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Goblins.root}/config/spritesheet-20x20.png",
|
57
|
+
"#{Pixelart::Module::Goblins.root}/config/spritesheet-20x20.csv",
|
58
|
+
width: 20,
|
59
|
+
height: 20 )
|
60
|
+
end
|
38
61
|
## note: for now class used for "namespace" only
|
39
62
|
def self.find_by( name: ) ## return archetype/attribute image by name
|
40
|
-
|
41
|
-
Goblins.generator.find( name )
|
63
|
+
builtin.find_by( name: name )
|
42
64
|
end
|
43
65
|
end # class Spritesheet
|
44
66
|
## add convenience (alternate spelling) alias - why? why not?
|
45
67
|
SpriteSheet = Spritesheet
|
46
68
|
Sheet = Spritesheet
|
47
69
|
Sprite = Spritesheet
|
48
|
-
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
class Image < Pixelart::Image
|
74
|
+
def self.generator
|
75
|
+
@generator ||= Artfactory.use( Lilgoblin::Sheet.builtin,
|
76
|
+
image_class: Image )
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
NAMES = ['lilgoblin', 'lilgoblins', 'lilgoblinz']
|
81
|
+
|
82
|
+
DEFAULT_ATTRIBUTES = ['Green', 'Orange Beanie',
|
83
|
+
'Earring Silver', 'Blue Sweater']
|
84
|
+
|
85
|
+
def self.generate( *names )
|
86
|
+
generator.generate( *names )
|
87
|
+
end # method Image.generate
|
88
|
+
end # class Image
|
89
|
+
end # module Lilgoblin
|
49
90
|
|
50
91
|
|
51
92
|
### add some convenience shortcuts
|
52
|
-
|
53
|
-
## add singular too -why? why not?
|
54
|
-
Goblin = Goblins
|
93
|
+
LilGoblin = Lilgoblin
|
55
94
|
|
56
95
|
|
57
96
|
|
@@ -62,4 +101,4 @@ include Pixelart
|
|
62
101
|
|
63
102
|
|
64
103
|
|
65
|
-
puts Goblins.banner # say hello
|
104
|
+
puts Pixelart::Module::Goblins.banner # say hello
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goblins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.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-
|
11
|
+
date: 2022-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: artfactory
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.2.0
|
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:
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,9 +58,9 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '3.23'
|
61
|
-
description: goblins - generate your own 20×20
|
62
|
-
from text attributes (via built-in
|
63
|
-
sizes and more
|
61
|
+
description: goblins - generate your own 24×24 goblins or 20×20 lil'goblins (pixel)
|
62
|
+
monster avatar images (off-blockchain) from text attributes (via built-in spritesheets);
|
63
|
+
incl. 2x/4x/8x zoom for bigger sizes and more
|
64
64
|
email: wwwmake@googlegroups.com
|
65
65
|
executables: []
|
66
66
|
extensions: []
|
@@ -73,9 +73,13 @@ files:
|
|
73
73
|
- Manifest.txt
|
74
74
|
- README.md
|
75
75
|
- Rakefile
|
76
|
+
- config/spritesheet-20x20.csv
|
77
|
+
- config/spritesheet-20x20.png
|
78
|
+
- config/spritesheet-24x24.csv
|
79
|
+
- config/spritesheet-24x24.png
|
76
80
|
- lib/goblins.rb
|
77
81
|
- lib/goblins/version.rb
|
78
|
-
homepage: https://github.com/
|
82
|
+
homepage: https://github.com/profilepic/text-to-image
|
79
83
|
licenses:
|
80
84
|
- Public Domain
|
81
85
|
metadata: {}
|
@@ -99,7 +103,7 @@ requirements: []
|
|
99
103
|
rubygems_version: 3.3.7
|
100
104
|
signing_key:
|
101
105
|
specification_version: 4
|
102
|
-
summary: goblins - generate your own 20×20
|
103
|
-
from text attributes (via built-in
|
104
|
-
sizes and more
|
106
|
+
summary: goblins - generate your own 24×24 goblins or 20×20 lil'goblins (pixel) monster
|
107
|
+
avatar images (off-blockchain) from text attributes (via built-in spritesheets);
|
108
|
+
incl. 2x/4x/8x zoom for bigger sizes and more
|
105
109
|
test_files: []
|