backgrounds 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +1 -0
- data/lib/backgrounds/base.rb +27 -0
- data/lib/backgrounds/image.rb +1 -1
- data/lib/backgrounds/version.rb +1 -1
- data/lib/backgrounds.rb +6 -23
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce5ceaeec5820f6228efef0307ce81074b0abe17150d783103f0f14ab94c9cb9
|
4
|
+
data.tar.gz: 0d85d1ff3f7654eba5e5a27549061920c82057591b1af87400336eed770e08d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a351154a8111ac3d164e499588c177b6d0d58548d1caa9f3fcc1c37f981367bea20d1750885c4e01a5c7a6fa44a48cadeb6c8d4def93ea15178afd36f0380c21
|
7
|
+
data.tar.gz: 50161fa579c83011271b9e441c60a730881fcfd1828c1bf7581f3ef9dde21331955373cc7faeffa2e20636c3d575f2f929577beb212d6e814c49aa6032a62fdd
|
data/Manifest.txt
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
## 3rd party
|
2
|
+
require 'pixelart/base'
|
3
|
+
require 'spritesheet/base'
|
4
|
+
|
5
|
+
|
6
|
+
## our own code
|
7
|
+
require 'backgrounds/version' # note: let version always go first
|
8
|
+
require 'backgrounds/image'
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
module Pixelart
|
14
|
+
class Image
|
15
|
+
def background( *values )
|
16
|
+
img = Background::Image.generate( *values,
|
17
|
+
width: @img.width,
|
18
|
+
height: @img.height )
|
19
|
+
img.compose!( self )
|
20
|
+
img # note: return new image
|
21
|
+
end
|
22
|
+
end # class Image
|
23
|
+
end # module Pixelart
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
puts Pixelart::Module::Backgrounds.banner # say hello
|
data/lib/backgrounds/image.rb
CHANGED
@@ -47,7 +47,7 @@ class Image < Pixelart::Image
|
|
47
47
|
img.ukraine
|
48
48
|
elsif ['pride','rainbow'].include?( value.downcase )
|
49
49
|
img.pride
|
50
|
-
elsif sheet && pattern=sheet.find_by( name: value ) ## try some built-in background patterns
|
50
|
+
elsif sheet && pattern=sheet.find_by( name: value, warn: false ) ## try some built-in background patterns
|
51
51
|
img.compose!( pattern )
|
52
52
|
img
|
53
53
|
else ### assume color
|
data/lib/backgrounds/version.rb
CHANGED
data/lib/backgrounds.rb
CHANGED
@@ -1,27 +1,10 @@
|
|
1
|
-
##
|
2
|
-
require '
|
3
|
-
require 'spritesheet'
|
1
|
+
## our own code (without "top-level" shortcuts e.g. "modular version")
|
2
|
+
require 'backgrounds/base' # aka "strict(er)" version
|
4
3
|
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
###
|
6
|
+
# add convenience top-level shortcuts / aliases
|
7
|
+
# make Image, Color, Palette8bit, etc top-level
|
8
|
+
include Pixelart
|
9
9
|
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
module Pixelart
|
14
|
-
class Image
|
15
|
-
def background( *values )
|
16
|
-
img = Background::Image.generate( *values,
|
17
|
-
width: @img.width,
|
18
|
-
height: @img.height )
|
19
|
-
img.compose!( self )
|
20
|
-
img # note: return new image
|
21
|
-
end
|
22
|
-
end # class Image
|
23
|
-
end # module Pixelart
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
puts Pixelart::Module::Backgrounds.banner # say hello
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backgrounds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
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-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- config/spritesheet-24x24.csv
|
91
91
|
- config/spritesheet-24x24.png
|
92
92
|
- lib/backgrounds.rb
|
93
|
+
- lib/backgrounds/base.rb
|
93
94
|
- lib/backgrounds/image.rb
|
94
95
|
- lib/backgrounds/version.rb
|
95
96
|
homepage: https://github.com/pixelartexchange/pixelart
|