<small id='HCRlx'></small><noframes id='HCRlx'>

      <legend id='HCRlx'><style id='HCRlx'><dir id='HCRlx'><q id='HCRlx'></q></dir></style></legend>
        <bdo id='HCRlx'></bdo><ul id='HCRlx'></ul>

      <i id='HCRlx'><tr id='HCRlx'><dt id='HCRlx'><q id='HCRlx'><span id='HCRlx'><b id='HCRlx'><form id='HCRlx'><ins id='HCRlx'></ins><ul id='HCRlx'></ul><sub id='HCRlx'></sub></form><legend id='HCRlx'></legend><bdo id='HCRlx'><pre id='HCRlx'><center id='HCRlx'></center></pre></bdo></b><th id='HCRlx'></th></span></q></dt></tr></i><div id='HCRlx'><tfoot id='HCRlx'></tfoot><dl id='HCRlx'><fieldset id='HCRlx'></fieldset></dl></div>
        <tfoot id='HCRlx'></tfoot>
      1. 如何在 cocos2d 中填充纹理?

        时间:2024-08-12
      2. <tfoot id='j1aVW'></tfoot>
      3. <small id='j1aVW'></small><noframes id='j1aVW'>

        • <i id='j1aVW'><tr id='j1aVW'><dt id='j1aVW'><q id='j1aVW'><span id='j1aVW'><b id='j1aVW'><form id='j1aVW'><ins id='j1aVW'></ins><ul id='j1aVW'></ul><sub id='j1aVW'></sub></form><legend id='j1aVW'></legend><bdo id='j1aVW'><pre id='j1aVW'><center id='j1aVW'></center></pre></bdo></b><th id='j1aVW'></th></span></q></dt></tr></i><div id='j1aVW'><tfoot id='j1aVW'></tfoot><dl id='j1aVW'><fieldset id='j1aVW'></fieldset></dl></div>
            <tbody id='j1aVW'></tbody>

            <legend id='j1aVW'><style id='j1aVW'><dir id='j1aVW'><q id='j1aVW'></q></dir></style></legend>
                  <bdo id='j1aVW'></bdo><ul id='j1aVW'></ul>

                  本文介绍了如何在 cocos2d 中填充纹理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个形状和纹理图像.. (shape.png, texture.png)

                  I have a shape and texture image.. (shape.png, texture.png)

                  我想在 cocos2d 中将形状绘制为 texture.png 图案.(形状大小比纹理图像大得多.所以自动填充整个形状的纹理图案.

                  I would like to paint a shape as texture.png pattern in cocos2d. (shape size is pretty bigger than texture image. so automatically fill texture pattern in entire shape.

                  我想知道路.

                  找不到..

                  有人有办法解决这个问题吗?

                  someone have a solution to solve this problem?

                  推荐答案

                  sprite = [[CCSprite alloc] initWithFile:@"texture.png"];
                  
                  ccTexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT};
                  [sprite.texture setTexParameters:&params];
                  [sprite setTextureRect: CGRectMake(0.0, 0.0, w, h)];
                  

                  此代码在 x 和 y(或纹理术语中的 s、t)中重复纹理.唯一的限制是您的纹理必须是 2 的幂(即 64 * 128、128 * 128、1024 * 1024)等.

                  This code repeats a texture in both the x and the y (or s, t in texture terms). The only limitation is that your texture must be a power of two (ie. 64 * 128, 128 * 128, 1024 * 1024) etc.

                  这篇关于如何在 cocos2d 中填充纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Cocos2d 人像模式在 iPhone 上不起作用 下一篇:Cocos2D 复杂动画

                  相关文章

                  <small id='TbBZY'></small><noframes id='TbBZY'>

                • <tfoot id='TbBZY'></tfoot><legend id='TbBZY'><style id='TbBZY'><dir id='TbBZY'><q id='TbBZY'></q></dir></style></legend>

                      <bdo id='TbBZY'></bdo><ul id='TbBZY'></ul>

                    1. <i id='TbBZY'><tr id='TbBZY'><dt id='TbBZY'><q id='TbBZY'><span id='TbBZY'><b id='TbBZY'><form id='TbBZY'><ins id='TbBZY'></ins><ul id='TbBZY'></ul><sub id='TbBZY'></sub></form><legend id='TbBZY'></legend><bdo id='TbBZY'><pre id='TbBZY'><center id='TbBZY'></center></pre></bdo></b><th id='TbBZY'></th></span></q></dt></tr></i><div id='TbBZY'><tfoot id='TbBZY'></tfoot><dl id='TbBZY'><fieldset id='TbBZY'></fieldset></dl></div>