J
J
jocry2014-09-02 22:33:09
C++ / C#
jocry, 2014-09-02 22:33:09

Cocos2d How to fill any shape with texture while preserving edges?

How to fill any shape with a texture (which class to use) while preserving the edges? An example in the picture. Do not create a large number of sprites.
44bbc656f4f04e89a54e67ce5d3f412d.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Trrrrr, 2014-09-14
@Trrrrr

Do you already have texture coordinates for the shape? If not, then you need to generate them (create a sweep), depending on the generated sweep, the result will change. Judging by what you want, then let's say if you have 128*128, then the size of the shape is 256*256. It turns out that the texture coordinates should be like this (I'll go clockwise from the bottom): (0, 0) (0, 1) (1.1) (1, 2) (2, 2) (2.0)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question