Search found 287 matches

by Bigfoot71
Mon Nov 21, 2022 5:35 pm
Forum: Support and Development
Topic: Cursor position at startup is always [0,0]
Replies: 12
Views: 1924

Re: Cursor position at startup is always [0,0]

It's strange, it doesn't happen to me, I'm on linux with MATE. Maybe you can report the bug if not to fix the problem temporarily I see two tips, either you force to reposition the mouse in the center of the display during startup, like this: local win_w, win_h = love.graphics.getDimensions() love.m...
by Bigfoot71
Mon Nov 21, 2022 4:59 pm
Forum: Support and Development
Topic: Cursor position at startup is always [0,0]
Replies: 12
Views: 1924

Re: Cursor position at startup is always [0,0]

For LÖVE to be able to capture the position of your mouse, it must already be in the window. In windowed mode if the mouse leaves the window the position will be the last one recorded in the window. You can now guess why LÖVE defines a default value at startup. If that really bothers you maybe you c...
by Bigfoot71
Sun Nov 20, 2022 9:58 pm
Forum: Libraries and Tools
Topic: GeoMan - Geometry library
Replies: 10
Views: 5301

Re: GeoMan - Geometry library

I am curious about performance intersects detection for multiple polygons at once, e.g. one player body and tens/hundreds of enemies. Here is a small demo that I just made very quickly. The player himself is represented by a polygon and there is an adjustable number of enemies (also represented by ...
by Bigfoot71
Sun Nov 20, 2022 5:32 pm
Forum: Libraries and Tools
Topic: GeoMan - Geometry library
Replies: 10
Views: 5301

Re: GeoMan - Geometry library

For further reading, check out my humble article at: https://2dengine.com/?p=intersections#Point_inside_triangle Thank you very much for your details, I will study all that for, it's really nice ! Please note that your code performs the same check twice i vs j and j vs i After rereading it seems to...
by Bigfoot71
Sun Nov 20, 2022 3:33 pm
Forum: Libraries and Tools
Topic: GeoMan - Geometry library
Replies: 10
Views: 5301

Re: GeoMan - Geometry library

Good job. Does the detection work well (speedwise) for multiple objects? Thank you very much, otherwise it depends on the type of detection, which one are you talking about ? I use most of these functions in my projects and haven't had any performance issues so far, if I have any I'll fix them. Aft...
by Bigfoot71
Sun Nov 20, 2022 3:27 pm
Forum: Libraries and Tools
Topic: GeoMan - Geometry library
Replies: 10
Views: 5301

Re: GeoMan - Geometry library

"Small" update including New functions: New function isPolySelfIntersect to test if a polygon/polyline self intersects. New function getPolyLength with the isLine parameter if we need to measure the length of a polyline or the perimeter of a polygon. New function getMiddle to get the midd...
by Bigfoot71
Thu Nov 17, 2022 2:19 pm
Forum: Support and Development
Topic: [SOLVED] Repeat texture in circle mesh (uv calculation)
Replies: 2
Views: 771

Re: Repeat texture in circle mesh (uv calculation)

Wow! I tried with setWrap but I couldn't and I understand why now, thank you ! But what is Cricle Map? And yes it's a small error on my part, I have a version in a "cheat sheet" folder called "createCircleMesh" and another that I put in my game that I renamed "createCircleMa...
by Bigfoot71
Thu Nov 17, 2022 1:10 pm
Forum: Support and Development
Topic: [SOLVED] Repeat texture in circle mesh (uv calculation)
Replies: 2
Views: 771

[SOLVED] Repeat texture in circle mesh (uv calculation)

Hello lovers ! I need help on how to repeat a texture in a circle mesh. I already have a function that fills a circular mesh with a texture, here it is: local createCricleMesh = function(image, r) local cos, sin, pi = math.cos, math.sin, math.pi local d = 2*r local segments = math.round(pi/math.acos...
by Bigfoot71
Wed Nov 16, 2022 4:04 pm
Forum: Support and Development
Topic: [SOLVED] How not to get additive alpha
Replies: 6
Views: 1092

Re: How not to get additive alpha

It should work to use the 'lighten' blend mode while drawing the shapes to a canvas, and then use (premultiplied) alpha blending when drawing/compositing the canvas to the screen. Thanks a lot ! I just got exactly the result I was looking for with the 'lighten' mode without canvas or shader ! There...
by Bigfoot71
Wed Nov 16, 2022 10:28 am
Forum: Support and Development
Topic: [SOLVED] How not to get additive alpha
Replies: 6
Views: 1092

Re: How not to get additive alpha

is there a reason you want to avoid them? The three reasons are: The fact that it existed may be a simpler and less expensive solution. The fact that if two colors are superimposed in the canvas, once the transparency is applied we will only see the color on top, so I would like the colors to add u...