goblins 0.0.1 → 1.0.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
  SHA256:
3
- metadata.gz: 8934478ccb4e270df14b0e9d19823390d2bc3f36b0e531dbf5c263160a63980b
4
- data.tar.gz: 4c46a7c81a5da2a9b44a6d5c375e32f7c5f9b5aad679113b77b42a11f2f60b5e
3
+ metadata.gz: bc5f809aece1ae4f64d98c4a4ccce5375107ca8729b9f2d294da5d83a1e3f028
4
+ data.tar.gz: d66b90e96129a852751544cdc7d3b2c0dfc94916eaff501cf7f925c8428619f4
5
5
  SHA512:
6
- metadata.gz: 894506428229bf434f555607a98f5b93d0f5887eaf59905b631c852b3f5039f61eac21a5fca3b4ab70f4c909f613a16ad00a36e7955f9672a93373aa58996d85
7
- data.tar.gz: 18307df6470dce85964c8b90a731cac1c61cb403acc0ae7fdf14f9298c0300255c501685c4598a7a616b52f92bd56846d7b98fefbde3a1a21d3b9218001ed624
6
+ metadata.gz: eecd66a046b4ef91f2eaaa92a80f4e78974a266123e9ece164cd3cf5a71d8f575b609ed405fbb11675e83c2f6f8fc4144a81ba559df83561dc764dce6ab30e5b
7
+ data.tar.gz: 457b7b2c1845eff2a7b30dc09ac5ad05cf845e54e9308c764f3d5babc30bad0101cfded8b2172bdbbe204de77f9b4df5f2e88b92bb771964747200aa17263bf2
data/Manifest.txt CHANGED
@@ -2,5 +2,9 @@ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ config/spritesheet-20x20.csv
6
+ config/spritesheet-20x20.png
7
+ config/spritesheet-24x24.csv
8
+ config/spritesheet-24x24.png
5
9
  lib/goblins.rb
6
10
  lib/goblins/version.rb
data/README.md CHANGED
@@ -1,25 +1,135 @@
1
- # Goblins (Pixel Avatars)
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
- * home :: [github.com/pixelartexchange/pixelart](https://github.com/pixelartexchange/pixelart)
8
- * bugs :: [github.com/pixelartexchange/pixelart/issues](https://github.com/pixelartexchange/pixelart/issues)
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
- goblins (pixel avatars)...
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
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin1.png)
48
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin2.png)
49
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin3.png)
50
+
51
+ In 4x:
52
+
53
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin1@4x.png)
54
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin2@4x.png)
55
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblin3@4x.png)
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
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin1.png)
84
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin2.png)
85
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin3.png)
86
+
87
+ In 4x:
88
+
89
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin1@4x.png)
90
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin2@4x.png)
91
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/lilgoblin3@4x.png)
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
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/i/goblins_originals-24x24@4x.png)
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
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/config/spritesheet-24x24.png)
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
+ ![](https://github.com/profilepic/text-to-image/raw/master/goblins/config/spritesheet-20x20.png)
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 [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
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 goblin (pixel avatar) images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more"
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/pixelartexchange/pixelart' }
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
- ['pixelart', '>= 1.3.1'],
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
@@ -1,10 +1,11 @@
1
1
 
2
-
2
+ module Pixelart
3
+ module Module
3
4
  module Goblins
4
5
 
5
- MAJOR = 0
6
+ MAJOR = 1
6
7
  MINOR = 0
7
- PATCH = 1
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 'pixelart/base'
1
+ ## our own "3rd" party gems
2
+ require 'artfactory/base'
3
3
 
4
4
 
5
5
 
6
6
  ## our own code
7
- require 'goblins/version' # note: let version always go first
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
- module Goblins
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
- def self.generator
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
- class Image
29
- def self.generate( *values, background: nil )
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
- # note: pass along name as q (query string)
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
- end # module Goblins
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
- Goblinz = Goblins
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.1
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-06-03 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pixelart
14
+ name: artfactory
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.1
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: 1.3.1
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 goblin (pixel avatar) images (off chain)
62
- from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger
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/pixelartexchange/pixelart
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 goblin (pixel avatar) images (off chain)
103
- from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger
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: []