Stipple
Re: Stipple
Can you give me the .love that hangs? Anyway, added proper line detection and table input, you can as always find it in the repo (also, in string:sub, you can use -1 instead of #string, -2 instead of #string-1, etc)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Stipple
Thanks for your offer of help.
Problem I encountered with love.graphics.getLineWidth was actually with my code, not yours.
I was setting the line width in newStipple and not draw so nothing happened when I used love.graphics.setLineWidth in love.draw.
My bad.
Found a simple work around so all happy hear.
Best
Problem I encountered with love.graphics.getLineWidth was actually with my code, not yours.
I was setting the line width in newStipple and not draw so nothing happened when I used love.graphics.setLineWidth in love.draw.
My bad.
Found a simple work around so all happy hear.
Best
Re: Stipple
Are you sure? … look at text in lower left corner.Nixola wrote: Stipple2 is basically my stipple ...)
OK1 I'll step back and let you run with this. My intent was to help, not be obnoxious.
That said, for this bunch you really need a racier name for your library. How about 'stripper',
Then they could require 'stripper'. Best. :>)
Edi1t:
Darn! Just can't seem to leave this alone.
Added to my version the ability to use either '11001111111100000000' or '200800000000' for the stipple pattern. Couldn't come up with an easy way to deal with the zeros.
Edit2:Now '2b8h' gives same results as using '11001111111100000000'. Don't know if this feature really helpful.
- Attachments
-
- stipple_Ref2.love
- stipple with modified pattern input
- (1.83 KiB) Downloaded 128 times
-
- stipple_Ref.love
- Slightly modified Nixola's code
- (1.63 KiB) Downloaded 126 times
-
- stipple_Nixola.love
- Nixola's code
- (1.8 KiB) Downloaded 129 times
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Stipple
About the numbers... if you have something like
you can put something like:
The first number is the quantity of ones you have, the second is the quantity of ceros, the third is quantity of ones, and so.
Since you start with one and the sequence starts with cero there are 0 ones and then 2 ceros.
Hope its helps is just an idea
Code: Select all
001100111111110000
Code: Select all
022284
Since you start with one and the sequence starts with cero there are 0 ones and then 2 ceros.
Hope its helps is just an idea
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: Stipple
Yes, that could be a nice idea, when I get some time I'll add it to the library (of course, unless I forget to do so). Thanks!
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Stipple
To port this to love 0.9.1 you'll just need to change line 62 from
to
I couldn't find any docs for this so here goes.
First load up stipple.lua using [wiki]love.filesystem.load[/wiki], the return value will be a function that we'll be using to create new stipples.
Next create a stipple using the returned function:
The newStipple only waits for one argument, the stipple pattern in string from, this pattern will be repeated to complete the line.
A 1 is a a cue to draw a pixel whereas 0 is the opposite and does not draw a pixel, this is done per pixel for the given line.
Now you can draw your newly created stipple in love.draw() using a pair of coordinates:
More stuff, you can use the :next() and :prev() (or :previous()) functions to advance or to backward the patter by one pixel.
Try it out, use the left and right keys to move the patterns, they'll move one pixel every half a second:
Code: Select all
lg.drawq(self.img, self.quad, x1, y1, a, lw, 1)
Code: Select all
lg.draw(self.img, self.quad, x1, y1, a, lw, 1)
First load up stipple.lua using [wiki]love.filesystem.load[/wiki], the return value will be a function that we'll be using to create new stipples.
Code: Select all
function love.load()
newStipple = love.filesystem.load('stipple.lua')
Code: Select all
stipple = newStipple('1111111100000000')
end
A 1 is a a cue to draw a pixel whereas 0 is the opposite and does not draw a pixel, this is done per pixel for the given line.
Now you can draw your newly created stipple in love.draw() using a pair of coordinates:
Code: Select all
function love.draw()
stipple:draw(0,0,love.graphics.getWidth(),love.graphics.getHeight())
end
Try it out, use the left and right keys to move the patterns, they'll move one pixel every half a second:
Code: Select all
function love.load()
newStipple = love.filesystem.load ('stipple.lua')
stipple = newStipple('1111111100000000')
time = 0
end
function love.update(dt)
if time > 0.5 then
if love.keyboard.isDown('right') then
stipple:next()
elseif love.keyboard.isDown('left') then
stipple:prev()
end
time = 0
end
end
function love.draw()
stipple:draw(0,0,love.graphics.getWidth(),love.graphics.getHeight())
end
Who is online
Users browsing this forum: No registered users and 67 guests