readymades 0.1.0 → 0.1.3

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: 7e42abcd56dde93dcb37257a6e6ed55f1e715a53853465401612ee8b84ee074d
4
- data.tar.gz: 2299276d0d16290888c82063f34e0241a8e20ac409e8bbe7fb8acdd5f3c0659a
3
+ metadata.gz: db3b90d1d365d4b15221780eaddfc07e9a97911de8f86d022f8b01a39ed0816c
4
+ data.tar.gz: '08e2f8d4c9b772dc2210202615964787d5f797e4557df4b87def02a88e3d32ab'
5
5
  SHA512:
6
- metadata.gz: d56fb208a42307865f3c9495805cc3eb9d6536a3b436b7ca0e2da7c3630e5b53b06f609e24c6d40622e1562d24d47d0bd95d8716890c89907fc1f1bc5ae67886
7
- data.tar.gz: a368e175eb5757ba179c5ae05d0e399a3a091a124dabb6b4c63603b9c475fdf6036f2fe5a7667d62cec70227c68fb68e9df8fe19fb5df94f4c514fdb47b2440a
6
+ metadata.gz: d7d5cbc45fb646bd1e5764541b28449c5c25e0c337fd40f9cdf07e92394bfb34218ab5b1680dc5f0bec55ebf1c347a8f0c5f07690f75ebcc4baa7b3dc43a07f5
7
+ data.tar.gz: c77e67c616cf6ec0d0f5b49aa1b2545ed7c4d7f52c27b64895305154d81ce54e571391843ed5504545908e209c9340106078e3ed351bbd979efa211270fcd9ac
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/pixelartexchange/originals) Presents
2
+
1
3
  # Readymades (1/1 Original Pixel Punks)
2
4
 
3
- Do-it-yourself (DIY) - yes, you can - generate your own 24×24 pixel punk images (off chain) from 1/1 originals incl. William Shakespare, Galileo Galilei, Mao Zedong, The Mask, The Joker, Bard Simpson, and many other readymade public world figures or cinema (fictional or cartoon) characters and add attributes / accessories with text (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
5
+ Yes, you can! Generate your own 24×24 pixel punk images (off chain) from 1/1 originals incl. William Shakespare, Galileo Galilei, Mao Zedong, The Mask, The Joker, Bard Simpson, and many other readymade public world figures or cinema (fictional or cartoon) characters and add attributes / accessories with text (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
4
6
 
5
7
 
6
8
 
@@ -27,4 +29,5 @@ readymade 1/1 pixel punks:
27
29
 
28
30
  ## Questions? Comments?
29
31
 
30
- Post them on the [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
32
+ Post them on the [D.I.Y. Punk (Pixel) Art reddit](https://old.reddit.com/r/DIYPunkArt). Thanks.
33
+
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ Hoe.spec 'readymades' do
27
27
 
28
28
  self.extra_deps = [
29
29
  ['cryptopunks'],
30
+ ['backgrounds', '>= 0.2.0'],
30
31
  ]
31
32
 
32
33
  self.licenses = ['Public Domain']
@@ -6,6 +6,7 @@ id, category, name, more_names
6
6
  4, , Snoop Dogg, Snoop
7
7
  5, , Bart Simpson, Bart | Simpson
8
8
  6, , Terminator,
9
- 7, , The Grinch, Grinch
10
- 8, , The Joker, Joker
11
- 9, , The Mask, Mask
9
+ 7, , Hannibal Lecter, Hannibal
10
+ 8, , The Grinch, Grinch
11
+ 9, , The Joker, Joker
12
+ 10, , The Mask, Mask
Binary file
@@ -4,7 +4,7 @@ module Readymades
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- PATCH = 0
7
+ PATCH = 3
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
data/lib/readymades.rb CHANGED
@@ -1,44 +1,30 @@
1
1
  ## 3rd party
2
2
  require 'cryptopunks' ### todo - add/change to cryptopunks/base !!!
3
-
3
+ require 'backgrounds/base' ## note: incl. backgrounds for now
4
+ ## (may get pulled in by cryptopunks later with update)
4
5
 
5
6
 
6
7
  ## our own code
7
8
  require 'readymades/version' # note: let version always go first
8
9
 
9
10
 
10
- ## forward define superclass for image
11
- module Readymades
12
- class Image < Pixelart::Image; end
13
- end
14
-
15
11
 
16
12
 
17
- ###
18
- ## todo/fix:
19
- ## use only a spritesheet class
20
- ## not generator for sprite lookup - why? why not?
21
- ## rework generator and break up in
22
- ## two classes (generator + spritesheet) - why? why not?
23
-
24
13
  ###
25
14
  ## add convenience pre-configurated generatored with build-in spritesheet (see config)
26
15
 
27
16
  module Readymades
28
17
 
29
- def self.generator
30
- @generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
31
- "#{root}/config/spritesheet.csv",
18
+ class Spritesheet ## note: for now class used for "namespace" only
19
+ def self.builtin ### check: use a different name e.g. default,standard,base or such - why? why not?
20
+ @sheet ||= Pixelart::Spritesheet.read( "#{Readymades.root}/config/spritesheet.png",
21
+ "#{Readymades.root}/config/spritesheet.csv",
32
22
  width: 24,
33
23
  height: 24 )
34
- end
35
-
24
+ end
36
25
 
37
- class Spritesheet
38
- ## note: for now class used for "namespace" only
39
26
  def self.find_by( name: ) ## return archetype/attribute image by name
40
- # note: pass along name as q (query string)
41
- Readymades.generator.find( name )
27
+ builtin.find_by( name: name )
42
28
  end
43
29
  end # class Spritesheet
44
30
  ## add convenience (alternate spelling) alias - why? why not?
@@ -48,36 +34,38 @@ module Readymades
48
34
 
49
35
 
50
36
 
51
- class Image
52
- def self.generate( *values, background: nil )
37
+ class Image < Pixelart::Image
53
38
 
54
- name = values[0]
55
- attribute_names = values[1..-1]
39
+ def self.generate( *names )
40
+ name = names[0]
41
+ more_names = names[1..-1]
56
42
 
57
43
  base = Readymade::Sheet.find_by( name: name )
58
44
 
59
- img = Image.new( 24, 24 )
45
+ img = new( base.width, base.height ) ## make base a Readymade::Image copy
60
46
  img.compose!( base )
61
47
 
62
- attribute_names.each do |attribute_name|
63
- attribute = Punk::Sheet.find_by( name: attribute_name,
64
- gender: 'm' )
65
- img.compose!( attribute )
66
- end
67
-
68
- if background
69
- img = if background.is_a?(String) && ['ua', 'ukraine'].include?( background.downcase )
70
- img.ukraine
71
- else
72
- img2 = Image.new( 24, 24, background )
73
- img2.compose!( img )
74
- img2
75
- end
76
- end
77
-
78
- ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
79
- new( 24, 24, img.image )
80
- end # method Image.generate
48
+ img.add!( *more_names )
49
+ img
50
+ end # method Image.generate
51
+
52
+
53
+ def add!( *names )
54
+ names.each do |name|
55
+ attribute = Punk::Sheet.find_by( name: name,
56
+ gender: 'm' )
57
+ compose!( attribute )
58
+ end
59
+ self
60
+ end
61
+
62
+ def add( *names ) ### todo/check: find a better name/alternate names - why? why not?
63
+ img = self.class.new( width, height ) ## make a Readymade::Image copy
64
+ img.compose!( self )
65
+
66
+ img.add!( *names)
67
+ img
68
+ end
81
69
  end # class Image
82
70
  end # module Readymades
83
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readymades
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
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-01 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cryptopunks
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: backgrounds
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rdoc
29
43
  requirement: !ruby/object:Gem::Requirement