Implementing mask feature for images

Fixes #32.
This commit is contained in:
Andy Meneely
2015-02-01 23:04:39 -05:00
parent f5e5b1326d
commit 7a53f68393
9 changed files with 127 additions and 20 deletions
+5 -6
View File
@@ -26,7 +26,7 @@ describe Squib::Card do
card = Squib::Card.new(@deck, 100, 150)
# png(file, x, y, alpha, blend, angle)
card.png('foo.png', 37, 38, :native, :native, 0.9, :none, 0.0)
card.png('foo.png', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
end
it 'sets blend when needed' do
@@ -34,9 +34,8 @@ describe Squib::Card do
expect(@context).to receive(:operator=).with(:overlay).once
card = Squib::Card.new(@deck, 100, 150)
card.png('foo.png', 37, 38, :native, :native, 0.9, :overlay, 0.0)
card.png('foo.png', 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
end
end
context '#svg' do
@@ -55,7 +54,7 @@ describe Squib::Card do
card = Squib::Card.new(@deck, 100, 150)
# svg(file, id, x, y, width, height, alpha, blend, angle)
card.svg('foo.png', 'id', 37, 38, :native, :native, 0.9, :none, 0.0)
card.svg('foo.png', 'id', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
end
it 'sets blend when needed' do
@@ -64,7 +63,7 @@ describe Squib::Card do
expect(@context).to receive(:operator=).with(:overlay).once
card = Squib::Card.new(@deck, 100, 150)
card.svg('foo.png', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0)
card.svg('foo.png', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
end
it 'sets width & height when needed' do
@@ -74,7 +73,7 @@ describe Squib::Card do
expect(@context).to receive(:scale).with(2.0, 3.0).once
card = Squib::Card.new(@deck, 100, 150)
card.svg('foo.png', nil, 37, 38, 200, 300, 0.9, :none, 0.0)
card.svg('foo.png', nil, 37, 38, 200, 300, 0.9, :none, 0.0, nil)
end
end