article thumbnail

Tutorial: Cocos Shader Series - Use a Noise Map to Make a Dissolve Texture

Cocos

Blockquote const sprite = this.getComponent(Sprite); const mat = sprite.customMaterial; mat.setProperty(‘dissolveThreshold’, 0.5); Version 3.6.x, x, I using this code but it not bring Property affect to shader Ok, this work if turn of Packable in main Sprite inspector

Shaders 98
article thumbnail

[Tutorial]Outer Stroke Effect for 2D Sprites

Cocos

Original: [link] Author: BitByBit Outer Stroke Effect for 2D Sprites Continuing from the previous article Inner Stroke Effect for 2D Sprites Introduction In the last article, we introduced the method of inner stroke and also discussed its pros and cons. _OutlineSize is the stroke width. It is roughly as shown below.

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

How to get an array of pixel colors from an image?

Cocos

I installed extensions in VS C (Cocos Effect, Shader languages support for VS Code) my next thought was to get into the shader to try working with the texture there, but I ran into difficulties: 1.) I couldn’t find the right package for working with textures to get pixel colors #include <common/texture/texture-lod> 2.)

Pixel 52
article thumbnail

Can't set texture for spriteframe

Cocos

i wrote a little code to load asset texture from resource. i wrote a little code to load asset texture from resource. 0 ){ let l = new Node; this.node.insertChild(l,cnt); this.label[i][j] = l.addComponent(Sprite); const sf = new SpriteFrame(); sf.texture = tex[0]; this.label[i][j].spriteFrame var tex = Array(25).fill(new

Texture 40
article thumbnail

Can't set texture for spriteframe

Cocos

first, I recommend you to follow the TS style when you are coding, that will make your code easy to read. from your code, I guess you want to load some text images and cache them to an array, then you use them to create the spriteFrames when needed. hello ,bro. for example, use let instead of var. the error comes out.

Texture 40
article thumbnail

[CC 3.8.1] AnimationClip.createWithSpriteFrames not working

Cocos

hi, I am leaning CC, I am more interested write code than using tool CC, but that is not working. I am using CC version 3.8.1 I am using CC version 3.8.1 createAnimationArray(bien,['23020_0_8', '23020_0_9', '23023_3_6'], 0.1, createAnimationArray(bien,['23020_0_8', '23020_0_9', '23023_3_6'], 0.1,

article thumbnail

Sprite Outline Shader in Unity

Febucci

In this “Unity Sprite Outline” tutorial we’ll discover how to create both a “Sprite Innerline” and a “Outer Sprite Outline”. Simply, the Inner Sprite Outline shader is drawn “inside” the sprite, while “Outer” is the opposite. Read more about “Texture’s Texel Size” here. Inner Sprite Outline HLSL.

Sprite 52