Is it possible to tile a triangle like you can with quads?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Is it possible to tile a triangle like you can with quads?
I am making a platformer map with slopes but I am not sure how to give a triangle a tile effect.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Is it possible to tile a triangle like you can with quads?
Have you checked the wiki on [wiki]Mesh[/wiki]es? They have a lot of arguments but they basically allow you to create some weird [wiki]Quad[/wiki]s using UV coordinates (the coordinate in the image) and coordinates (the coordinate in screen) for each vertex. And you get the extra benefit of per-vertex attributes like colors and whatever you may add
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: Is it possible to tile a triangle like you can with quads?
Dialglex, I haven't done it myself, but my impression is that people typically create a rectangular tile image, where half of the image is transparent and the other half is "painted" with the triangle image. But an actual triangle is input into the physics system (I don't think the bump collision library has support for triangles/slopes, so hardon-collider or box2d/physics is probably used). But others with more knowledge can probably correct me and give more details.
Re: Is it possible to tile a triangle like you can with quads?
peterrust, how would I make half of it transparent? I already had the idea, but I just didn't know how to do it.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Is it possible to tile a triangle like you can with quads?
You edit it with a software like GIMP, Photoshop or other image editor
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: Is it possible to tile a triangle like you can with quads?
Dialglex wrote:how would I make half of it transparent?
Right... gimp and Photoshop are so powerful, they can be hard to figure out. There are plenty of smaller image editors out there, I really like aseprite, which is designed for pixel art, but it's not free. http://www.piskelapp.com/ is an online one that's free, I'm sure there are others. You'll probably want to save in the PNG format, which has good support for transparency. How exactly to make half the pixels transparent depends on the editor, sometimes there will be a "Background Color" property that you can set to a fully transparent color, other times you can just use an eraser tool to clear out the pixels that you want to be transparent.Positive07 wrote:You edit it with a software like GIMP, Photoshop or other image editor
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Is it possible to tile a triangle like you can with quads?
I didn't want to recommend a pixel art oriented tool for the simple reason that he may not be using those kind of graphics, and editting real graphics with a pixel art tool is not really what you want. The magic wand in both GIMP and Photoshop is really simple to use and you can easily remove everything that is made of the same (or similar) color
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: Is it possible to tile a triangle like you can with quads?
Thanks for the replies, I have used meshes and it is almost done but it is stretching the image because it is it is not a square shaped triangle. How would I make it not stretch?
Re: Is it possible to tile a triangle like you can with quads?
You need to use proper UV coordinates, is all.
Re: Is it possible to tile a triangle like you can with quads?
I am but all it is doing is tilting the image.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests