article thumbnail

Maximum number of sprites?

Cocos

I’m not getting any errors, it simply doesn’t show a sprite. In fact, the sprite that I pull from the cache isn’t null, but nothing shows up. Later, when I want the sprites, I call jerseySprite = Sprite::createWithSpriteFrameName(jerseyName); Right now, I’m wondering if maybe I’m doing something wrong.

Sprite 40
article thumbnail

How to change sprite of Mask component with SPRITE STENCIL type?

Cocos

Sprite component is automatically added to the node. I get this Sprite component from the code and set the SpriteFrame I need for it. I display in the console which SpriteFrame is set for the Sprite component. However, instead of a mask on the sprite, visually I see just a rectangle (as if the sprite was not applied).

Sprite 40
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Physics and sprite animation dont works

Cocos

Basically the problem is here: sprite->runAction(RepeatForever::create(animate)); If i comment this line, it works. I made a small project to show: GitHub GitHub - paulocoutinhox/axmol-bomb-test Contribute to paulocoutinhox/axmol-bomb-test development by creating an account on GitHub.

Sprite 52
article thumbnail

Handle the collision of sprites

Cocos

I’m trying to handle the collision of two sprites, i added BoxCollider2D to the sprites. One sprite can jump (changing the y coordinate through animation), named "character ", the other is a static object, named “key”. code for the "character ". code for the “key”. code for the "character ". start () {.

article thumbnail

Changing vertexData of a sprite in 2D in cocos creator 3.6.2

Cocos

Hello all, I am trying to change the vertices(vertex, index, position, uv) for the sprite in code at runtime. I was able to change the vertices of the sprite frame by assigning the values to sprite.spriteframe.vertices and setting sprite.setVertsDirty(), but in CC3.6 Any suggestion for best way to achieve this in CC3.6

Sprite 40
article thumbnail

Changing vertexData of a sprite in 2D in cocos creator 3.6.2

Cocos

Hello all, I am trying to change the vertices(vertex, index, position, uv) for the sprite in code at runtime. I was able to change the vertices of the sprite frame by assigning the values to sprite.spriteframe.vertices and setting sprite.setVertsDirty(), but in CC3.6 Any suggestion for best way to achieve this in CC3.6

Sprite 40
article thumbnail

Changing vertexData of a sprite in 2D in cocos creator 3.6.2

Cocos

Hello all, I am trying to change the vertices(vertex, index, position, uv) for the sprite in code at runtime. I was able to change the vertices of the sprite frame by assigning the values to sprite.spriteframe.vertices and setting sprite.setVertsDirty(), but in CC3.6 Any suggestion for best way to achieve this in CC3.6

Sprite 40