faiface / pixel

A hand-crafted 2D game library in Go
MIT License
4.46k stars 245 forks source link

How to create textured vertex #276

Open edwinsyarief opened 3 years ago

edwinsyarief commented 3 years ago

Hi @faiface, is it possible to render line with texture? I want to create rope with texture.

Thank you.

jakubDoka commented 3 years ago

you have two options, or you use repeating texture on multiple sprites and chain them together, assuming you already have phizycs for your rope, or you go deep into pixel source and learn how sprite works.

Breafly every vertex (called TriangleData in pixel) has texture position intensity and color, you care about texture, i recomend you to study some opengl, as what you are demanding is low level technical issue. I coudl do this for you but have no time rn and dont want to advertize my products here.

To sum it up pisxel is small lib that does as match with as little. You can easily use it as framework to create new functionality, all you have to do is not limit your self only to sprite and batch but dig deep into it.