How can i make a polygon physical shape with sti and Tiled?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Yani354
Prole
Posts: 13
Joined: Wed May 24, 2023 5:21 pm

How can i make a polygon physical shape with sti and Tiled?

Post by Yani354 »

I want to make a box2d polygon shape with Tiled/sti, but i don't know how to do it.
Could someone explain?

demo:
game.love
(21 KiB) Downloaded 59 times
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: How can i make a polygon physical shape with sti and Tiled?

Post by darkfrei »

Yani354 wrote: Wed Oct 11, 2023 5:42 pm I want to make a box2d polygon shape with Tiled/sti, but i don't know how to do it.
Could someone explain?

demo:
game.love
Like this?
viewtopic.php?p=218447#p218447

Also:
Challacade wrote:In Tiled, you can go to View -> Snapping to turn off grid snapping, so you can set things at the individual pixel level. Then for polygons, you can draw polygons on the object layer, there's a dedicated tool for that. www.youtube.com/watch?v=IHmF_bRpOAE
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Yani354
Prole
Posts: 13
Joined: Wed May 24, 2023 5:21 pm

Re: How can i make a polygon physical shape with sti and Tiled?

Post by Yani354 »

darkfrei wrote: Wed Oct 11, 2023 7:07 pm
Yani354 wrote: Wed Oct 11, 2023 5:42 pm I want to make a box2d polygon shape with Tiled/sti, but i don't know how to do it.
Could someone explain?

demo:
game.love
Like this?
viewtopic.php?p=218447#p218447

Also:
Challacade wrote:In Tiled, you can go to View -> Snapping to turn off grid snapping, so you can set things at the individual pixel level. Then for polygons, you can draw polygons on the object layer, there's a dedicated tool for that. www.youtube.com/watch?v=IHmF_bRpOAE
I meant is it possible rather than a rectangular shape to be an a polygon shape

Code: Select all

physics.shape = love.physics.newRectangleShape(width, height --area.lua line 15)
which you create through tiled

Code: Select all

function Map:spawnEntities() -- map.lua line 20
	for k, v in ipairs(Map.level.layers.entity.objects) do
		if v.type == "area" then
			Area:new(v.x + v.width / 2, v.y + v.height / 2,v.width,v.height)
		end
	end
end
i know that i should use this: https://love2d.org/wiki/love.physics.newPolygonShape
but i don't know how to implemented.
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: How can i make a polygon physical shape with sti and Tiled?

Post by darkfrei »

Also I've tried to make polygons for tiled world: viewtopic.php?p=255788#p255788
Image
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Yani354
Prole
Posts: 13
Joined: Wed May 24, 2023 5:21 pm

Re: How can i make a polygon physical shape with sti and Tiled?

Post by Yani354 »

darkfrei wrote: Thu Oct 12, 2023 10:38 am Also I've tried to make polygons for tiled world: viewtopic.php?p=255788#p255788
Image
i am asking is it possible to create a polygon with the program "Tiled" and to create it as a physical object with sti and box2d

everything i am trying to do is on the game.love
game.love
(21 KiB) Downloaded 39 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 6 guests