Bibhandgemalt

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Bibhandgemalt

Post by BrotSagtMist »

This is Bibhandgemalt.
bibhandgemalt.love
(5.46 KiB) Downloaded 121 times
A lib that when loaded and activated intercepts
love.graphics.line, circle and rectangle to make them look like they where painted with a pen.
Instructions in the file.
ssss.png
ssss.png (149.2 KiB) Viewed 3706 times
Attachments
bibhandgemalt.zip
(5.46 KiB) Downloaded 109 times
Last edited by BrotSagtMist on Tue Oct 04, 2022 5:25 pm, edited 2 times in total.
obey
User avatar
knorke
Party member
Posts: 237
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Bibhandgemalt

Post by knorke »

That is a neat effect and the demo with showcase is nice as well. :crazy:

1) Would be nice if it worked with text and love.graphics.polygon
For example when shapes are drawn like this:

Code: Select all

love.graphics.polygon ("line", v.b:getWorldPoints(v.s:getPoints()))
2) When drawing rectangles with "line" style then setLineWidth () has no effect.
(the rect outline is always 1 pixel wide)

As test, I added it to my game viewtopic.php?p=250233#p250233 See the screenshots, to be honest it did not look as good as I had hoped but I did not try any adjustments yet. Just added BH.on() on top main.lua
I think there is lots of potential in this lib.

3) Somehow it draws over the letter-boxes of TLfres (yes, I know it an older lib and my version is a bit customized)

4) It seems as if canvases are drawn with transparent alpha when handgemalt is active?
Attachments
1664020827.png
1664020827.png (69.4 KiB) Viewed 4013 times
1664019984.png
1664019984.png (59.07 KiB) Viewed 4013 times
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: Bibhandgemalt

Post by BrotSagtMist »

Polygons are not in my scope really. Anyone advanced enough to use them could write such lib themself.

This lib basically only uses love.graphics.points.
I can probably just add setLineWidth=setPointSize to make thickness work, ill add that if i do an update.
BUT the pen styles have their own thickness already.

It draws over the letterbox?

No it should not mess with any canvas stuff.

Looking at your circles i should tweak the default values to something sane, but hey it works, not bad for a drop in.
obey
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: Bibhandgemalt

Post by BrotSagtMist »

Ive done the update already. Thanks rainweather.
Please try again.
obey
User avatar
knorke
Party member
Posts: 237
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Bibhandgemalt

Post by knorke »

The new default values do look nicer.
BrotSagtMist wrote: Sat Sep 24, 2022 12:30 pmIt draws over the letterbox?
Yes, or rather pillarbox in this case. https://en.wikipedia.org/wiki/Pillarbox
The blue rectangle is the playable area where stuff gets drawn. The red circle at bottom left should only be barely visible since it is "off screen." (compare with attachment without handgemalt)
download/file.php?id=21586
How can I just post a link to the attached picture without it automatically showing as picture?
Attachments
1659142060.png
1659142060.png (73.24 KiB) Viewed 3993 times
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: Bibhandgemalt

Post by BrotSagtMist »

Huh i can not explain this.
I dont even see how this picture can be transformed into the upper picture by this lib :D
Like this are circle silouhetes and the lib tries to fill them.
And anything that covers this circle at the letterbox would cover the lib circles too.
Fun fun fun.
obey
User avatar
knorke
Party member
Posts: 237
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Bibhandgemalt

Post by knorke »

It is a mystery.
Here is another strange effect, which I guess has to do with transparency of canvases.
Sorry, I am too lazy to make a minimal test example:
1) Start the gamebasewithhandgemalt24092022.love
2) Press space to switch from "single view" to "multiple view"
3) Use asdw to move around in the top left screen. all is well.
4) Now uncomment --BH.on() in line 2 of main.lua
5) Start, press space, move around
6) Notice how the static single-view level is still drawn in the background.
7) Comment out line 11 drawLevel (0,20,0,20) in ingame.lua and there is no more "over draw"

My ingameDraw function is something like:

Code: Select all

  	drawLevel (0,20,0,20)
   	printAllPlayers (800,20)
   	drawUnits ()
   	if splitScreen then
		for i=1, #views do
			drawView(views[i])
		end
So it draws the level and if "splitscreen" is active then it just draws those extra views on top of the single-view. (this is just wip-code, obviously)
Thing is, when handgemalt is active then the drawLevel (0,20,0,20)'s graphics are still visible, while without handgemalt they get fully drawn over by the other draw-stuff.
It could well be something wrong in my code, so I do not want to see you on a wild goose chase. ;) Just thought it was interesting.
Attachments
gamebasewithhandgemalt24092022.love
(19.15 KiB) Downloaded 102 times
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: Bibhandgemalt

Post by BrotSagtMist »

Oh i had wrong defaults for rectangles too.
Fixed they look pretty nice.

Okey it took me way longer to see this too so dont feel ashamed: There is no bug. Its behaving exactly as it is supposed to do.
Youre overwriting your entire screen with black bars, these black bars now have holes in them, the holes are partly defined by their shape, so being a long vertical block they just have this pattern:
Image

Personally id say this looks like a mayor resource waste. You can just make these bars using scissors which stop rendering in that area instead to render and then overwrite it.
You can _fix_ this by just moving BH.on() under your require stack since the black bars apparently make their own copy of rectangle.
Also note that your game screen appears to be rendered several times, see how thick the right boxes are compared to the left.
obey
User avatar
knorke
Party member
Posts: 237
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Bibhandgemalt

Post by knorke »

BrotSagtMist wrote: Sat Sep 24, 2022 6:22 pm...these black bars now have holes in them, the holes are partly defined by their shape, so being a long vertical block they just have this pattern:
Ah, yes, so obvious in hindsight. The solid filled rects are just not fully opaque anymore.
Personally id say this looks like a mayor resource waste. You can just make these bars using scissors which stop rendering in that area instead to render and then overwrite it.
Thanks, I did not not know about scissors. I think in this case the resource waste is negligible because the game's whole graphics are only a dozen circles and some lines.
Also note that your game screen appears to be rendered several times, see how thick the right boxes are compared to the left.
I think that is just a left-over test code that I had forgotten.
In file ingame.lua, line 11 there is drawLevel (0,20,0,20)
That line is not needed and its output gets overdrawn by the actual graphics. Just with the handgemalt it became noticeable.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Bibhandgemalt

Post by Gunroar:Cannon() »

BrotSagtMist wrote: Sat Sep 24, 2022 11:24 am
love.graphics.line, circle and rectangle to make them look like they where painted with a pen.
I'm telling the truth.
The ding dong truth.


I SWEAR ON THE RED-EYED-DEATH-OGRE-EATING-DRAGON THAT LIVES UNDER MY BED I WAS WISHING A LIB LIKE THIS EXISTED JUST THE OTHER DAY!!

I haven't visited the library section of the forum in years :rofl:

Wow, real nice. What does it mean? Bib...hand painted? Baby paint?
Maybe you could make it more sketch like (edit: I mean chaotic) with different passes or something ... I don't know, kinda like this

Image
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 13 guests