coolcats 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 86246698ce26e02b56b6b9474adc3323ccb78359e1f63547b30e9476d9dde693
4
+ data.tar.gz: 147d11723068844d4d907e12ae86cc9bdc97a25eb6859be404bb4d9c4f6a3b5d
5
+ SHA512:
6
+ metadata.gz: 80ef11ec6ed05e6e357b313748a739fc90293443d038c13338ca81d14263d12b01bfc18ab629178af18d4c2198d94942685766a27aaf82e1bf49efb0d40a1a7a
7
+ data.tar.gz: 7a35931c14f37da591267b5d93f8177476d6f9d6181ada6db4dbac5ceff176ebff427a56ffea671e72d9e0b10af936c219cf55c89c79805c3267004d0ebc42f0
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 0.0.1 / 2021-05-19
2
+
3
+ * Everything is new. First release
data/Manifest.txt ADDED
@@ -0,0 +1,8 @@
1
+ CHANGELOG.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ config/spritesheet.csv
6
+ config/spritesheet.png
7
+ lib/coolcats.rb
8
+ lib/coolcats/version.rb
data/README.md ADDED
@@ -0,0 +1,155 @@
1
+ # Coolcats (Pixel Cats)
2
+
3
+ coolcats - generate your own 24×24 pixel cat images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
4
+
5
+
6
+
7
+ * home :: [github.com/pixelartexchange/pixelart](https://github.com/pixelartexchange/pixelart)
8
+ * bugs :: [github.com/pixelartexchange/pixelart/issues](https://github.com/pixelartexchange/pixelart/issues)
9
+ * gem :: [rubygems.org/gems/coolcats](https://rubygems.org/gems/coolcats)
10
+ * rdoc :: [rubydoc.info/gems/coolcats](http://rubydoc.info/gems/coolcats)
11
+
12
+
13
+
14
+
15
+ ## Usage
16
+
17
+ Let's generate some super-rare never-before-seen
18
+ coolcats (pixel cats):
19
+
20
+ ```ruby
21
+ require 'coolcats'
22
+
23
+
24
+ coolcat = Coolcat::Image.generate( 'Ditto', 'Beret Red' )
25
+ coolcat.save( "coolcat1.png")
26
+ coolcat.zoom(4).save( "coolcat1@4x.png" )
27
+
28
+ coolcat = Coolcat::Image.generate( 'Hearts', 'Afro Black' )
29
+ coolcat.save( "coolcat2.png")
30
+ coolcat.zoom(4).save( "coolcat2@4x.png" )
31
+
32
+ coolcat = Coolcat::Image.generate( 'Unamused' )
33
+ coolcat.save( "coolcat3.png")
34
+ coolcat.zoom(4).save( "coolcat3@4x.png" )
35
+ ```
36
+
37
+ Voila!
38
+
39
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat1.png)
40
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat2.png)
41
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat3.png)
42
+
43
+ In 4x:
44
+
45
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat1@4x.png)
46
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat2@4x.png)
47
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat3@4x.png)
48
+
49
+
50
+
51
+ ```ruby
52
+ ## try tv heads
53
+
54
+ coolcat = Coolcat::Image.generate( 'TV Head White', 'TV Face 404' )
55
+ coolcat.save( "coolcat4.png")
56
+ coolcat.zoom(4).save( "coolcat4@4x.png" )
57
+
58
+ coolcat = Coolcat::Image.generate( 'TV Head Grey', 'TV Face No Signal' )
59
+ coolcat.save( "coolcat5.png")
60
+ coolcat.zoom(4).save( "coolcat5@4x.png" )
61
+
62
+ coolcat = Coolcat::Image.generate( 'TV Head Purple', 'TV Face XP' )
63
+ coolcat.save( "coolcat6.png")
64
+ coolcat.zoom(4).save( "coolcat6@4x.png" )
65
+ ```
66
+
67
+ Voila!
68
+
69
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat4.png)
70
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat5.png)
71
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat6.png)
72
+
73
+ In 4x:
74
+
75
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat4@4x.png)
76
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat5@4x.png)
77
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat6@4x.png)
78
+
79
+
80
+
81
+ ```ruby
82
+ ## try halloween theme
83
+
84
+ coolcat = Coolcat::Image.generate( 'Jack' )
85
+ coolcat.save( "coolcat7.png")
86
+ coolcat.zoom(4).save( "coolcat7@4x.png" )
87
+
88
+ coolcat = Coolcat::Image.generate( 'Scream' )
89
+ coolcat.save( "coolcat8.png")
90
+ coolcat.zoom(4).save( "coolcat8@4x.png" )
91
+
92
+ coolcat = Coolcat::Image.generate( 'Beret Red', 'Skull' )
93
+ coolcat.save( "coolcat9.png")
94
+ coolcat.zoom(4).save( "coolcat9@4x.png" )
95
+ ```
96
+
97
+ Voila!
98
+
99
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat7.png)
100
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat8.png)
101
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat9.png)
102
+
103
+ In 4x:
104
+
105
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat7@4x.png)
106
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat8@4x.png)
107
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/coolcat9@4x.png)
108
+
109
+
110
+ And so on.
111
+
112
+ ### Bonus - Look-Up Attributes (Via Built-In Spritesheet)
113
+
114
+
115
+ Let's look-up some attributes:
116
+
117
+ ```ruby
118
+ base = Coolcat::Sheet.find_by( name: 'Base' )
119
+ beanie_orange = Coolcat::Sheet.find_by( name: 'Beanie Orange' )
120
+ costume_gorilla = Coolcat::Sheet.find_by( name: 'Costume Gorilla' )
121
+ overalls_blue = Coolcat::Sheet.find_by( name: 'Overalls Blue' )
122
+
123
+ base.save( "base.png" )
124
+ beanie_orange.save( "beanie_orange.png" )
125
+ costume_gorilla.save( "costume_gorilla.png" )
126
+ overalls_blue.save( "overalls_blue.png" )
127
+
128
+ base.zoom( 4 ).save( "base@4x.png" )
129
+ beanie_orange.zoom( 4 ).save( "beanie_orange@4x.png" )
130
+ costume_gorilla.zoom( 4 ).save( "costume_gorilla@4x.png" )
131
+ overalls_blue.zoom( 4 ).save( "overalls_blue@4x.png" )
132
+ ```
133
+
134
+ Voila!
135
+
136
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/base.png)
137
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/beanie_orange.png)
138
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/costume_gorilla.png)
139
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/overalls_blue.png)
140
+
141
+ In 4x:
142
+
143
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/base@4x.png)
144
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/beanie_orange@4x.png)
145
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/costume_gorilla@4x.png)
146
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/coolcats/i/overalls_blue@4x.png)
147
+
148
+ And so on.
149
+
150
+
151
+
152
+
153
+ ## Questions? Comments?
154
+
155
+ Post them on the [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ require 'hoe'
2
+ require './lib/coolcats/version.rb'
3
+
4
+ ###
5
+ # hack/ quick fix for broken intuit_values - overwrite with dummy
6
+ class Hoe
7
+ def intuit_values( input ); end
8
+ end
9
+
10
+
11
+
12
+ Hoe.spec 'coolcats' do
13
+
14
+ self.version = Coolcats::VERSION
15
+
16
+ self.summary = "coolcats - generate your own 24×24 pixel cat images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more"
17
+ self.description = summary
18
+
19
+ self.urls = { home: 'https://github.com/pixelartexchange/pixelart' }
20
+
21
+ self.author = 'Gerald Bauer'
22
+ self.email = 'wwwmake@googlegroups.com'
23
+
24
+ # switch extension to .markdown for gihub formatting
25
+ self.readme_file = 'README.md'
26
+ self.history_file = 'CHANGELOG.md'
27
+
28
+ self.extra_deps = [
29
+ ['pixelart', '>= 1.3.1'],
30
+ ]
31
+
32
+ self.licenses = ['Public Domain']
33
+
34
+ self.spec_extras = {
35
+ required_ruby_version: '>= 2.3'
36
+ }
37
+
38
+ end
@@ -0,0 +1,68 @@
1
+ id, name, type, more_names
2
+ 0, Base, Archetype - Cool Cat,
3
+ 1, Angry, Attribute - Face,
4
+ 2, Angry Cute, Attribute - Face,
5
+ 3, Beard Brown, Attribute - Face,
6
+ 4, Derp, Attribute - Face,
7
+ 5, Ditto, Attribute - Face,
8
+ 6, Dizzy, Attribute - Face,
9
+ 7, Face Face, Attribute - Face,
10
+ 8, Glasses, Attribute - Face,
11
+ 9, Glasses Funny, Attribute - Face,
12
+ 10, Glossy, Attribute - Face,
13
+ 11, Grin, Attribute - Face,
14
+ 12, Happy, Attribute - Face,
15
+ 13, Happy Cute, Attribute - Face,
16
+ 14, Hearts, Attribute - Face,
17
+ 15, Mononoke, Attribute - Face,
18
+ 16, Mummy, Attribute - Face,
19
+ 17, Ninja Black, Attribute - Face,
20
+ 18, Ninja Blue, Attribute - Face,
21
+ 19, Ninja Red, Attribute - Face,
22
+ 20, Owo, Attribute - Face,
23
+ 21, Pixel, Attribute - Face,
24
+ 22, Stunned, Attribute - Face,
25
+ 23, Sunglasses Blue, Attribute - Face,
26
+ 24, Sunglasses Cool, Attribute - Face,
27
+ 25, Sunglasses Heart, Attribute - Face,
28
+ 26, Sunglasses Pixel, Attribute - Face,
29
+ 27, TV Face 404, Attribute - Face,
30
+ 28, TV Face Bob Ross, Attribute - Face,
31
+ 29, TV Face No Signal, Attribute - Face,
32
+ 30, TV Face XP, Attribute - Face,
33
+ 31, Unamused, Attribute - Face,
34
+ 32, Uwu, Attribute - Face,
35
+ 33, Wink, Attribute - Face,
36
+ 34, Afro Black, Attribute - Hat,
37
+ 35, Afro Rainbow Unicorn, Attribute - Hat,
38
+ 36, Beanie Orange, Attribute - Hat,
39
+ 37, Beanie Red, Attribute - Hat,
40
+ 38, Beret Red, Attribute - Hat,
41
+ 39, Bucket Hat Tan, Attribute - Hat,
42
+ 40, Costume Dragon, Attribute - Hat,
43
+ 41, Costume Frog, Attribute - Hat,
44
+ 42, Costume Gorilla, Attribute - Hat,
45
+ 43, Flower Blue, Attribute - Hat,
46
+ 44, Flower Pink, Attribute - Hat,
47
+ 45, Flower Red, Attribute - Hat,
48
+ 46, Halo, Attribute - Hat,
49
+ 47, Visor Yellow, Attribute - Hat,
50
+ 48, Sun Hat White, Attribute - Hat,
51
+ 49, TV Head Grey, Attribute - Hat,
52
+ 50, TV Head Purple, Attribute - Hat,
53
+ 51, TV Head White, Attribute - Hat,
54
+ 52, Bandana Red, Attribute - Clothes,
55
+ 53, Buttondown Black Flannel, Attribute - Clothes,
56
+ 54, Buttondown Red Flannel, Attribute - Clothes,
57
+ 55, Chain, Attribute - Clothes,
58
+ 56, Gown White, Attribute - Clothes,
59
+ 57, Overalls Blue, Attribute - Clothes,
60
+ 58, Shirt White, Attribute - Clothes,
61
+ 59, Sweater Orange, Attribute - Clothes,
62
+ 60, Tanktop White, Attribute - Clothes,
63
+ 61, T-Shirt Blue, Attribute - Clothes,
64
+ 62, Work Blue, Attribute - Clothes,
65
+ 63, Jack, Attribute - Halloween,
66
+ 64, Jason, Attribute - Halloween,
67
+ 65, Scream, Attribute - Halloween,
68
+ 66, Skull, Attribute - Halloween,
Binary file
@@ -0,0 +1,23 @@
1
+
2
+
3
+ module Coolcats
4
+
5
+ MAJOR = 0
6
+ MINOR = 1
7
+ PATCH = 0
8
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
9
+
10
+ def self.version
11
+ VERSION
12
+ end
13
+
14
+ def self.banner
15
+ "coolcats/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
16
+ end
17
+
18
+ def self.root
19
+ File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
20
+ end
21
+
22
+ end # module Coolcats
23
+
data/lib/coolcats.rb ADDED
@@ -0,0 +1,67 @@
1
+ ## 3rd party
2
+ require 'pixelart/base'
3
+
4
+
5
+
6
+ ## our own code
7
+ require 'coolcats/version' # note: let version always go first
8
+
9
+
10
+ ## forward define superclass for image
11
+ module Coolcats
12
+ class Image < Pixelart::Image; end
13
+ end
14
+
15
+ ###
16
+ ## add convenience pre-configurated generatored with build-in spritesheet (see config)
17
+
18
+ module Coolcats
19
+
20
+ def self.generator
21
+ @generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
22
+ "#{root}/config/spritesheet.csv",
23
+ width: 24,
24
+ height: 24 )
25
+ end
26
+
27
+
28
+ class Image
29
+ def self.generate( *values, background: nil )
30
+ ## note: always auto-add base coolcat archetye by default
31
+ img = Coolcats.generator.generate( 'Base', *values, background: background )
32
+ ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
33
+ new( 24, 24, img.image )
34
+ end # method Image.generate
35
+ end # class Image
36
+
37
+
38
+ class Spritesheet
39
+ ## note: for now class used for "namespace" only
40
+ def self.find_by( name: ) ## return archetype/attribute image by name
41
+ # note: pass along name as q (query string)
42
+ Coolcats.generator.find( name )
43
+ end
44
+ end # class Spritesheet
45
+ ## add convenience (alternate spelling) alias - why? why not?
46
+ SpriteSheet = Spritesheet
47
+ Sheet = Spritesheet
48
+ Sprite = Spritesheet
49
+ end # module Coolcats
50
+
51
+
52
+ ### add some convenience shortcuts
53
+ CoolCats = Coolcats
54
+ ## add singular too -why? why not?
55
+ Coolcat = Coolcats
56
+ CoolCat = Coolcats
57
+
58
+
59
+
60
+
61
+ ###
62
+ # note: for convenience auto include Pixelart namespace!!! - why? why not?
63
+ include Pixelart
64
+
65
+
66
+
67
+ puts Coolcats.banner # say hello
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: coolcats
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Bauer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pixelart
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '4.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.23'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.23'
61
+ description: coolcats - generate your own 24×24 pixel cat images (off chain) from
62
+ text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes
63
+ and more
64
+ email: wwwmake@googlegroups.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files:
68
+ - CHANGELOG.md
69
+ - Manifest.txt
70
+ - README.md
71
+ files:
72
+ - CHANGELOG.md
73
+ - Manifest.txt
74
+ - README.md
75
+ - Rakefile
76
+ - config/spritesheet.csv
77
+ - config/spritesheet.png
78
+ - lib/coolcats.rb
79
+ - lib/coolcats/version.rb
80
+ homepage: https://github.com/pixelartexchange/pixelart
81
+ licenses:
82
+ - Public Domain
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options:
86
+ - "--main"
87
+ - README.md
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '2.3'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubygems_version: 3.3.7
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: coolcats - generate your own 24×24 pixel cat images (off chain) from text
105
+ attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and
106
+ more
107
+ test_files: []