layer FadeOut action 貌似 默认 CascadeOpacity 都是关闭的
如果是关闭状态,子节点的 透明度就不受父节点的影响.
开启方法
layer->setCascadeOpacityEnabled(true)
layer->isCascadeOpacityEnabled() //可获取开启状态
墨衍会员
·
AI 创作全网分发
墨衍智能分发
本文由作者通过墨衍一键同步至各平台
1分发平台
2.4k累计阅读
2.4k平均单平台
已同步平台
CSDN
微信公众号
微博
知乎
掘金
百家号
博客园
抖音
小红书
你的文章也可以这样分发
墨衍会员 ¥399起/年,写一次发全网
我也要 →
码龄19年
layer FadeOut action 貌似 默认 CascadeOpacity 都是关闭的
如果是关闭状态,子节点的 透明度就不受父节点的影响.
开启方法
layer->setCascadeOpacityEnabled(true)
layer->isCascadeOpacityEnabled() //可获取开启状态
从零到一:手把手教你用YonBuilder for NCC搭建NC Cloud 2021.11开发环境(含避坑指南)
本文详细指导如何使用YonBuilder for NCC搭建NC Cloud 2021.11开发环境,涵盖硬件要求、软件安装、YonBuilder配置及常见故障排除。特别提供避坑指南,帮助开发者快速上手NCC开发,确保环境配置的原子化分解和开发思维的体系化建立。
Morris算法遍历二叉树
中序遍历步骤 如果当前节点左子节点(cur.left)为空,输出当前节点(cur),进入右子节点(cur.right)。 如果当前节点左子节点(cur.left)非空,找到当前节点左子树的最右节点(mostRight): 1)如果该节点的右子节点(mostRight.right)为空,则将其指针指向当前节点(cur),进入左子节点(cur.left)。 2)如果该节点的右子节点(mostRight.right)非空,则将其指针置为空,输出当前节点(cur),进入右子节点(cur.right)。
Unity特效序列帧输出全攻略:Recorder+Timeline保姆级教程(解决透明通道问题)
本文提供Unity特效序列帧输出的完整解决方案,重点讲解如何结合Recorder与Timeline工具,实现带透明通道的PNG序列帧高效输出。通过保姆级教程,详细解析摄像机隔离、层级设置、参数配置等关键步骤,并深度解决透明通道丢失等常见问题,帮助特效师和动画师打通引擎创作与后期合成的工作流。
cocos creator移动事件和 opacity
当node在节点node的touchEvent中 如果节点node在touch_move中有opacity的改变。在touch_end或者touch_cancel事件中,在还原的时候会出现一些问题。 出现问题的假设是该node有多个子节点,而子节点会随着父节点node的改变也会发生改变,这点很神奇,这个bug找了好长时间才找到, 在开始设置改变该node的opacity时,只要设置一个属性就
CTP-API开发系列之三:柜台系统简介
综合交易平台(Comprehensive Transaction Platform,CTP)是专门为期货公司开发的一套期货经纪业务管理系统,由交易、风险控制和结算三大系统组成。接下来分享的内容,对于期货公司的负责交易、运维同事会比较熟悉,针对CTP-API接口对接的朋友可以了解一下,在接口之上的系统是怎样的。
STM32F103循迹小车PID调参实战:手把手教你整定舵机PD与电机PI参数
本文详细介绍了基于STM32F103的循迹小车PID调参实战,重点讲解舵机PD控制与电机PI参数的整定技巧。通过硬件选型、基础测试、四步调参法和分段控制策略,帮助开发者解决小车蛇形走位等问题,提升循迹性能。文章还分享了高级调试技巧和典型问题排查方法,适用于智能车竞赛和机器人开发。
cocos2dx中Opacity属性及相关操作(1)
Opacity指的是Node的透明度,从0~255之间的一个整数,通过Node的setOpacity来进行设置:
Windows配置L2TP/IPsec连接
Windows 系统的 L2TP/IPsec 功能,通过配置即可构建加密 VPN 通道。
Cocos 子节点的渐变失效的处理
今天在游戏中加了个战斗数值显示,其中就有用到渐变的效果,发现竟然没有生效,查看了源代码发现子节点的opacity值跟随父节点的opacity更新是有前提的,那就是这货:_cascadeOpacityEnabled。请看源代码: void Node::setOpacity(GLubyte opacity) { _displayedOpacity = _realOpacity = opaci
安路TangDynasty和FD和JTAG驱动器安装
安路FPGA产品矩阵包含SALPHOENIX高性能、SALEAGLE高性价比和SALELF低功耗三大系列,广泛应用于网络通信、消费电子等领域。配套的TangDynasty(TD)集成开发环境支持标准设计输入,提供完整优化流程与调试工具。简要介绍了TD 6.2.1版本的安装步骤。
ApacheCordova 13 +Vs 2026 项目搭建教程_开发环境搭建教程
本文介绍基于Cordova 13.0.0、Android 13.0.0及JDK 21.0.8的开发环境搭建流程。通过npm全局安装Cordova CLI创建项目,配置JDK与Android SDK环境变量(Java_Home、ANDROID_SDK_ROOT),并设置Gradle 8.14.7路径。使用VS Code配合CordovaTools插件进行开发调试,验证adb devices连接状态。特别说明VS2026中JDK/Sdk位于H:\dev\vsshared\Android目录,适用于.Net MA
cocos2dx 3.x 中setOpacity 在子节点绘制中的延续问题
最近在项目开发中遇到一个问题,就是特效用cocos studio 做的特效在项目中使用时老是出现显示不正确的问题,后测试发现,只要在改变Opacity的父节点下添加Layer 就会显示异常,翻查源码发现,Layer直接继承与Node类,而Node类中的控制是否向子节点延伸opacity的值,也就是_cascadeOpacityEnabled默认是false,所以导致一遇到Layer就终止了opac
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
cocos2dx3.x中Opacity和visible
当我们需要场景中的某个精灵不可见时可能会面临两种选择,特别地,我们可能经常使用Fadein和Fadeout表示淡入淡出的特效,而当我调用Fadeout淡出精灵时,其实本质上是在对精灵的Opacity,即精灵的透明度进行操作。透明度操作并不会影响精灵的Visible即可见属性。 综合来讲,当精灵的Opacity属性设置为0时,在场景中是不可见的,但是其visible为true,也就是说该精灵仍然被渲染;而当我们将该精灵的visible设置为fasle时,尽管该精灵不可见,但其实其opacity为25...
霍尼韦尔SoftMaster使用说明
霍尼韦尔SoftMaster使用说明
Probability and Statistics - 4th edition
Probability and Statistics - 4th edition
setCascadeOpacityEnabled
setCascadeOpacityEnabled Enable or disable cascade opacity, if cascade enabled, child nodes' opacity will be the multiplication of parent opacity and its own opacity. 转载于:https://www.cnblogs.co...
jdk-8u144-linux-x64.tar.gz.
该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包
cocos2d-x-2.2.6子类随父类透明度变化而变化setCascadeOpacityEnabled(true)
setCascadeOpacityEnabled
Cocos 2dx - lua 透明度设置setOpacity()不起作用的解决方案
子节点跟随父节点透明度变化 self.rootNode:setCascadeOpacityEnabled(true) -- 如果是关闭状态,子节点的 透明度就不受父节点的影响,开启父节点级联透明度开关,设置透明度 self.rootNode:setOpacity(0) ...
cocos2dx对所有子节点设置透明度
看到cocos2dx2.2.5发布了,修复了输入框的bug,于是我们的项目也升级到了2.2.5, 升级过程还是比较顺利,没想到后来发现设置透明度无效了。 经过调试发现要调用一下setCascadeOpacityEnabled ( true ),结果还是没有效果, 又继续调试,原来noe没父节点不会更新自己的透明度,于是改为如下: void CCNode::setOpacity(
透明度设置:opacity与rgba
opacity:不透明度,用于设置整体属性得不透明,意味着其后代属性也会不透明。 文字也一起半透明了 rgba:一般用于调整background-color,color,box-shadow等的透明度 文字并不半透明
creator 遇到的问题--更新中.
layout 父节点透明子节点不透明 creator 2.0 已经移除了 cascadeOpacity 的相关方法 解决办法--> 给layout中的sprite设置一张透明的图片。 完美解决 creator 代码中的require的文件不能加 .js require("gameData.js") 要改为require("gameData"), 否则微信小程...
cocos2d-x对Layer设置setOpacity()不起作用的解决办法(十分坑爹)
本来狠正常的一个Layer,我想把它整个设置为半透明,结果就是不起作用,后来发现解决办法十分坑爹: layer:setCascadeOpacityEnabled(true) layer:setOpacity(255 * 0.4) 我就不明白了,官方为啥不把cascadeOpacityEnabled默认设为true呢?这不纯搞人呢么?文档里又不说,StackOverflow上都搜不到,妈蛋
Cocos2d-x Sprite 执行 CCFade~ 这类透明度变化动作的一些问题
在引擎中提供了几个有关透明度变化的动作:CCFadeIn,CCFadeOut,CCFadeTo CCFadeIn:the opacity from 0 to 255 CCFadeOut:the opacity from 255 to 0 CCFadeTo: from the current value to a custom one 下面简单记录一下我所遇到的一些问题:
cocos2d设置子节点不随父节点的透明度和可见性改变
Vector childrenVec = m_MaskBg->getChildren(); for (int i = 0; i < childrenVec.size(); i++) { childrenVec.at(i)->setCascadeColorEnabled(false); childrenVec.at(i)->setCascadeOpac
CCNodeRGBA
CCNodeRGBA继承于CCNode,所以它拥有CCNode的所有特性,并且它也继承于CCRGBAProtocol。从名字看来我们就知道它是一个带有颜色和透明度的节点。 所以它比起CCNode就多了2个特性,Opacity和RGB值。 如果要给子节点传递透明度属性,那么需要设置setCascadeOpacityEnabled(true),如果传递的过程中遇到了CCNode,那么传递会
cocos2d-x 使用CCLabelAtlas自定义字体
原创文章,欢迎转载!转载请注明: 转载自Cocos2D开发网--Cocos2Dev.com 原文链接地址: cocos2d-x 使用CCLabelAtlas自定义字体 有时候游戏中要用到一些特殊的字体效果,特别是数字。 CCLabelAtlas就可以从png图中读取文字。 CCLabelAtlas* diceCount=CCLabelAtlas::label
控件设置alpha或者layer的opacity时,他的子类的透明度也会跟着变成透明
控件设置alpha或者layer的opacity时,他的子类的透明度也会跟着变成透明 解决方法如下: view.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.25];
689

被折叠的 条评论
为什么被折叠?



