<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 中填充纹理?

        How to fill texture in cocos2d?(如何在 cocos2d 中填充纹理?)
      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 中填充纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)

                    <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>

                            <tbody id='TbBZY'></tbody>
                          • <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>