readymades 0.0.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7966c323b642e9b8f573de77f3da48c96f1b06ac0934ce97fb8e84ce4a262897
4
- data.tar.gz: 2f32892edec469334c959940b3a118530049b04b1657b3d963e922c7bb4fff87
3
+ metadata.gz: 43cb3cfcff230eb0fc32988e684471b6613fc079ea245f93a3f078eaa25ac799
4
+ data.tar.gz: ddfd9dceede005734ba433a219c8d579428c3fb70c448d61cce7c254e9ee5fac
5
5
  SHA512:
6
- metadata.gz: e80a0d5edf8cfcf17eef9b5d1dadbeac421e847ae7aa286413828b7841900c704251c1ce8b46898841e4697d43c9ed91b0464b671b4566049f2b512604ec165f
7
- data.tar.gz: 504126e69b94ba6cd7a051b76eb65af8dd338ae238956fe82c74555a9311869182ef633591c5ba4b909d012d7dae38fbd1c2c5535f64ac8da5a69179ab16ec15
6
+ metadata.gz: cf4159a05348707805bbb20e8a132ecfe6ed10aec6cea82b05639d4e793c2f9eeba57dfaa957aeb49812f48edad558498f0453460e62f5a7e2eb8fccae14aed4
7
+ data.tar.gz: 1fd3c9432cf46dc07cf37d89df7dbb50aef16f59b1bbff2e15221288805fcddc48c1e6d7be9e64ff73b18e7b09674eedaa5f4b3bf2038cd01d5f97fb2fe5d292
data/Manifest.txt CHANGED
@@ -2,5 +2,7 @@ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ config/spritesheet.csv
6
+ config/spritesheet.png
5
7
  lib/readymades.rb
6
8
  lib/readymades/version.rb
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'],
30
31
  ]
31
32
 
32
33
  self.licenses = ['Public Domain']
@@ -0,0 +1,12 @@
1
+ id, category, name, more_names
2
+ 0, , William Shakespeare, Will | Will Shakespeare | Shakespeare
3
+ 1, , Dante Alighieri, Dante
4
+ 2, , Galileo Galilei, Galileo | Galilei
5
+ 3, , Mao Zedong, Mao
6
+ 4, , Snoop Dogg, Snoop
7
+ 5, , Bart Simpson, Bart | Simpson
8
+ 6, , Terminator,
9
+ 7, , Hannibal Lecter, Hannibal
10
+ 8, , The Grinch, Grinch
11
+ 9, , The Joker, Joker
12
+ 10, , The Mask, Mask
Binary file
@@ -3,8 +3,8 @@
3
3
  module Readymades
4
4
 
5
5
  MAJOR = 0
6
- MINOR = 0
7
- PATCH = 1
6
+ MINOR = 1
7
+ PATCH = 2
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
data/lib/readymades.rb CHANGED
@@ -1,16 +1,72 @@
1
1
  ## 3rd party
2
2
  require 'cryptopunks' ### todo - add/change to cryptopunks/base !!!
3
-
3
+ require 'backgrounds' ## 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
+
12
+
13
+ ###
14
+ ## add convenience pre-configurated generatored with build-in spritesheet (see config)
15
+
11
16
  module Readymades
12
- class Image < Pixelart::Image; end
13
- end
17
+
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",
22
+ width: 24,
23
+ height: 24 )
24
+ end
25
+
26
+ def self.find_by( name: ) ## return archetype/attribute image by name
27
+ builtin.find_by( name: name )
28
+ end
29
+ end # class Spritesheet
30
+ ## add convenience (alternate spelling) alias - why? why not?
31
+ SpriteSheet = Spritesheet
32
+ Sheet = Spritesheet
33
+ Sprite = Spritesheet
34
+
35
+
36
+
37
+
38
+ class Image < Pixelart::Image
39
+ def self.generate( *values, background: nil )
40
+
41
+ name = values[0]
42
+ attribute_names = values[1..-1]
43
+
44
+ base = Readymade::Sheet.find_by( name: name )
45
+
46
+ img = Image.new( 24, 24 )
47
+ img.compose!( base )
48
+
49
+ attribute_names.each do |attribute_name|
50
+ attribute = Punk::Sheet.find_by( name: attribute_name,
51
+ gender: 'm' )
52
+ img.compose!( attribute )
53
+ end
54
+
55
+ if background
56
+ img = if background.is_a?( Array ) ## support multiple background
57
+ img.background( *background )
58
+ else
59
+ img.background( background )
60
+ end
61
+ end
62
+
63
+ ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
64
+ new( 24, 24, img.image )
65
+ end # method Image.generate
66
+ end # class Image
67
+ end # module Readymades
68
+
69
+
14
70
 
15
71
 
16
72
  ### add some convenience shortcuts
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.0.1
4
+ version: 0.1.2
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-09 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'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rdoc
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +88,8 @@ files:
74
88
  - Manifest.txt
75
89
  - README.md
76
90
  - Rakefile
91
+ - config/spritesheet.csv
92
+ - config/spritesheet.png
77
93
  - lib/readymades.rb
78
94
  - lib/readymades/version.rb
79
95
  homepage: https://github.com/pixelartexchange/pixelart