Love2dCS icon indicating copy to clipboard operation
Love2dCS copied to clipboard

shapes?

Open Shadowblitz16 opened this issue 4 years ago • 4 comments

I was thinking what if Love2D implemented shape helpers and collision methods for them..

the shapes I where thinking of is..

  • Rect(int x1,int y1int ,x2,int y1)
  • Circ(int x1,int y1,int x2,int y2)
  • Line(int x1,int y2,int x2,int y2)
  • Poly(param int points)

all which inherit a abstract Shape class which contains

they could contains the following properties which effect each other

  • points a protected list of points or vector2s
  • x1 the minimum point x coordnet in points
  • y1 the minimum point y coordnet in points
  • x2 the maximum point x coordnet in points
  • y2 the maximum point y coordnet in points
  • x alieas for x1
  • y alieas for y1
  • w the maxiumum width of the shape
  • h the maximum height of the shape
  • rx the x radius or width from center to one side
  • ry the y radius or height from center to one side
  • cx the center x
  • cy the center y
  • line thickness or -1 for fill
  • line stipple
  • line join style
  • color
  • collision between shapes.

these properties would all be settable and gettable and would effect eachother.

these would be drawable with love.Graphic.Draw or Love.Graphics.<ShapeName>

they could be really useful for game dev and they wouldn't need to be part of the official love2dcs library if you don't want them to be

Shadowblitz16 avatar Jan 08 '20 05:01 Shadowblitz16

I think you mean need a function about drawing physical debugging. World:DebugDraw can show the conllision info : This may help you image

endlesstravel avatar Jan 08 '20 11:01 endlesstravel

@endlesstravel no I mean shapes for drawing and actual ingame collision detection

Shadowblitz16 avatar Jan 09 '20 02:01 Shadowblitz16

something like https://github.com/adnzzzzZ/windfield ? I agree with you, but i don't think I have the energy to write a C# version now.

endlesstravel avatar Jan 28 '20 09:01 endlesstravel

ok this can be kept open until you have time.

Shadowblitz16 avatar Jan 29 '20 05:01 Shadowblitz16