Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all 91052 articles
Browse latest View live

cocos3.15.1 android studio 编译不过去

$
0
0

@B_Tree 写道:

最开始默认的工程是编译不过去,原因是缺少android-22
我检查了sdk下的platforms发现只有25.就改成了25。还是不行

帖子: 1

参与者: 1

阅读整个主题


cocos2dx AssetsManager android下载报错

$
0
0

@313963253 写道:

D/Cocos2dxDownloader﹕ onSuccess(i:200 headers:[Lorg.apache.http.Header;@c95f813 file:/data/user/0/com.XXX.XXX/files/update_file/cocos2dx-update-temp-package.zip.tmp
D/cocos2d-x debug info﹕ downloading... 3%
D/cocos2d-x debug info﹕ downloading... 3%
D/cocos2d-x debug info﹕ downloading... 3%
D/cocos2d-x debug info﹕ downloading... 4%
D/cocos2d-x debug info﹕ downloading... 4%
D/cocos2d-x debug info﹕ can not open downloaded zip file /data/user/0/com.XXX.XXX/files/update_file/cocos2dx-update-temp-package.zip

帖子: 1

参与者: 1

阅读整个主题

引擎3.15,cocos2d::ui:textfield

$
0
0

@yueyidie 写道:

引擎3.15,uitextfield(cocos2d::ui:textfield),在iOS设备竖屏的竖屏设备上,9空格多次输入后,delelte删除键无法删除输入内容。横屏没有问题。系统ios10.2。麻烦引擎大大们看到帮忙给一个解决方案。

帖子: 1

参与者: 1

阅读整个主题

有不用anysdk,只独立接入微信的教程么?

使用cocos2d-x 3.15版本如何创建一个android项目

Spine 在 Web 版掉帧严重

$
0
0

@wangfuguii 写道:

我们的项目中有几个比较重的 Spine 动画,在 Native 中运行可以跑满 60 帧,在 Web 降到 40 帧,弱弱的问一句,有没有可能使用 web assembly 编译 Spine JS 运行时来提升性能?

帖子: 1

参与者: 1

阅读整个主题

大家最近不活跃了啊,是不是筹划3d呢 ,听说10月3d 会现身

弱弱的请教,设置了shader的节点淡出时会卡一下的问题

$
0
0

@RazgrizHsu 写道:

是这样的,

我设定了一个Node,带了模糊效果,
结果在淡出的时候,这个节点会卡一下,也就是不像其他Node在淡出时那么自然

请教各位前辈,
我是应该在淡出之前,将该节点的shader停止,还是该如何做呢?

请前辈们指点,感谢

附带shader的代码:

const _vert = `
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec4 a_color;
varying vec2 v_texCoord;
varying vec4 v_fragmentColor;
void main()
{
    gl_Position = ( CC_PMatrix * CC_MVMatrix ) * a_position;
    v_fragmentColor = a_color;
    v_texCoord = a_texCoord;
}
` 
const _vert_no_mvp = `
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec4 a_color;
varying vec2 v_texCoord;
varying vec4 v_fragmentColor;
void main()
{
   gl_Position = CC_PMatrix  * a_position;
   v_fragmentColor = a_color;
   v_texCoord = a_texCoord;
}
`
const _frag = `
#ifdef GL_ES
precision mediump float;
#endif

varying vec2 v_texCoord;
uniform float u_strength;
uniform float u_widthStep;
uniform float u_heightStep;
const float blurRadius = 3.0;
const float blurPixels = ( blurRadius * 2.0 + 1.0 ) * ( blurRadius * 2.0 + 1.0 );
void main()
{
   float radius = blurRadius;
    vec3 sumColor = vec3( 0.0, 0.0, 0.0 );
    for(float fy = -blurRadius; fy <= blurRadius; ++fy )
    {
        for(float fx = -blurRadius; fx <= blurRadius; ++fx)
        {
            vec2 coord = vec2( fx * u_widthStep, fy * u_heightStep );
            sumColor += texture2D( CC_Texture0, v_texCoord + coord ).rgb;
        }
    }
    gl_FragColor = vec4( mix( texture2D( CC_Texture0, v_texCoord ).rgb, sumColor / blurPixels, u_strength ), 1.0 );;
}
`
let shaderClass = cc.Class(
{
    extends: cc.Component,
   editor:
   {
      requireComponent:  cc.Sprite,
      executeInEditMode: true,
   },
    properties:
   {
      previewId: { default: null, editorOnly: true, visible: false, },
      _program:  { default: null, visible: false, },
      Strength:  { default: 0.8, type: cc.Float, },
   },
    onLoad()
   {
      this.updateRender();
    },
    onEnable()
   {
      this.node.on( 'touchstart', function (event) { event.stopPropagation(); });
      this.node.on( 'touchend', function (event) { event.stopPropagation(); });
    },
   onDestroy()
   {
      //if ( this.previewId !== null ) clearInterval( this.previewId );
   },
   onFocusInEditor()
   {
      this.updateRender();
      // if ( this.previewId !== null ) clearInterval( this.previewId );
      // this.previewId = setInterval( this.updateRender.bind( this ), 1 );
   },
   onLostFocusInEditor()
   {
      //if ( this.previewId !== null ) clearInterval( this.previewId );
   },

   updateRender()
   {
      this.render( this.Strength );
   },
    render( strength )
    {
      if ( !this._program ) this._program = new cc.GLProgram();
        if ( cc.sys.isNative )
        {
            this._program.initWithString( _vert_no_mvp, _frag );
            this._program.link();
            this._program.updateUniforms();
            const glProgram_state = cc.GLProgramState.getOrCreateWithGLProgram( this._program );
        }
        else
        {
            this._program.initWithVertexShaderByteArray( _vert, _frag );

            this._program.addAttribute( cc.macro.ATTRIBUTE_NAME_POSITION, cc.macro.VERTEX_ATTRIB_POSITION);
            this._program.addAttribute( cc.macro.ATTRIBUTE_NAME_COLOR, cc.macro.VERTEX_ATTRIB_COLOR);
            this._program.addAttribute( cc.macro.ATTRIBUTE_NAME_TEX_COORD, cc.macro.VERTEX_ATTRIB_TEX_COORDS);
            this._program.link();
            this._program.updateUniforms();
      }

      this._uniStrength  = this._program.getUniformLocationForName( "u_strength" );
      this._uniWidthStep = this._program.getUniformLocationForName( "u_widthStep" );
      this._uniHeightStep    = this._program.getUniformLocationForName( "u_heightStep" );

        if ( cc.sys.isNative )
        {
            const glProgram_state = cc.GLProgramState.getOrCreateWithGLProgram( this._program );
         glProgram_state.setUniformFloat( "u_strength",    strength );
         glProgram_state.setUniformFloat( "u_widthStep",       ( 1.0 / this.node.getContentSize().width ) );
         glProgram_state.setUniformFloat( "u_heightStep",   ( 1.0 / this.node.getContentSize().height ) );
        }
        else
        {
            /* 模糊 0.5     */
         /* 细节 -2.0    */
         /* 细节 -5.0    */
         /* 细节 -10.0   */
         /* 边缘 2.0     */
         /* 边缘 5.0     */
         /* 边缘 10.0    */
         /* 模糊 1.0     */
         this._program.setUniformLocationWith1f( "u_strength",  ( strength + 0.2 ) );
         this._program.setUniformLocationWith1f( "u_widthStep", ( 1.0 / this.node.getContentSize().width ) );
         this._program.setUniformLocationWith1f( "u_heightStep",    ( 1.0 / this.node.getContentSize().height ) );
      }

        this.setProgram( this.node._sgNode, this._program );
    },
    setProgram( node, program )
   {
        if ( !cc.sys.isNative ) { node.setShaderProgram( program ); }
        else
        {
            let glProgram_state = cc.GLProgramState.getOrCreateWithGLProgram( program );
            node.setGLProgramState( glProgram_state );
        }
        let children = node.children;
        if (!children) return;
        for ( let i = 0; i < children.length; i++ ) this.setProgram( children[i], program );
    },
});

module.exports = shaderClass;

顺带请教一下,
设置了shader的节点,该如何让节点不再使用这个shader呢?

感激不尽:joy:

帖子: 1

参与者: 1

阅读整个主题


开发组有没有再发布时将脚本不合并的计划?

$
0
0

@maggame 写道:

我在开发一款大厅+小游戏的项目,目前这种脚本合并的方式不适用, 论坛上有人将游戏和大厅完全作为不同的项目,直接的数据共享方式和资源复用不是我想要的
开发组有计划没,这个需求应该很普遍啊~

帖子: 1

参与者: 1

阅读整个主题

大神求解,android项目编译报错

Cocos creator Dev 模式下,index.html是在哪个目录下读取的。

$
0
0

@pxd123456789 写道:

发帖须知:(请删除以下文本后再发帖)

发帖前请先搜索是否有相关帖子: http://forum.cocos.com/search?q=category%3Acreator%20
已经在论坛提交的内容,请勿重复在 QQ 上私信或 @ 开发者。
常见问题可先查看 FAQ: http://forum.cocos.com/t/faq-8-29/35510 或者在 Q 群咨询。

反馈 Bug 时请提供

  • Creator 版本号:
  • 目标平台:(Web / iOS / Android / 模拟器)
  • 详细报错信息,包含调用堆栈:
  • 做了什么操作引起的 Bug:
  • 之前是否有哪个版本是没问题的:

移动平台 Web 相关 Bug 请提供

  • 手机型号:
  • 手机浏览器:(微信 / QQ / 特定浏览器)

编辑器相关 Bug 请提供

  • 操作系统:
  • 编辑器之前是否有其它报错:

偶发 Bug 请提供

  • 出现概率:
  • 额外线索:(场景节点规模 / 项目资源规模等)

标题要能概括问题,例如:
《1.3.1 升级 1.4 问题》 可改成 《1.3.1 升级 1.4 后提示脚本找不到》
《不明白这句提示是什么意思,求解》 可改成 《模拟器报错 QuadCommand: resizing index size ...》
标题语气建议平和一点:
《急!!creator jsb 能否手动GC,卡顿严重》 可改成 《creator jsb 能否手动GC,卡顿严重》
《CocosCreator 严重Bug(触控的过来看看)》 可改成 《BitmapFont 路径报错,必现》

我保证会把这些发帖须知删掉后再发帖,如果我发的帖子出现了这句话,那证明我视力有问题。(大家快看我是呆逼呀!)

帖子: 1

参与者: 1

阅读整个主题

cocos2dx3.15版本 在IOS竖屏模式下软键盘用九宫格输入内容无法全部清除

$
0
0

@51082430 写道:

cocos2dx3.15,uitextfield(cocos2d::ui:textfield),在iOS设备使用竖屏模式,使用九宫格输入模式输入长内容文字后,无法用删除键删除输入但未确定的内容,造成无法正确输入内容,但此情况在横屏模式时不出现,只是在竖屏模式下无法正确清楚长内容输入,例如20个字的时候就会出问题

帖子: 4

参与者: 1

阅读整个主题

app启动就出现这个错误,麻烦引擎人员看下

$
0
0

@3600605 写道:

08-22 14:18:34.311: E/cocos2d-x(22654): cocos2d: warning, Director::setProjection() failed because size is 0
08-22 14:18:34.311: D/ViewRootImpl(22654): MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=2
08-22 14:18:34.311: D/Cocos2dxActivity(22654): onWindowFocusChanged() hasFocus=true
08-22 14:18:34.331: D/cocos2d-x(22654): cocos2d: fullPathForFilename: No file found at script/jsb_prepare.js. Possible missing file.
08-22 14:18:34.351: I/Timeline(22654): Timeline: Activity_idle id: android.os.BinderProxy@3ad233d time:435187895
08-22 14:18:34.361: D/cocos2d-x(22654): cocos2d: fullPathForFilename: No file found at script/jsb_boot.js. Possible missing file.
08-22 14:18:34.361: D/cocos2d(22654): android SDK version:23
08-22 14:18:34.381: I/System.out(22654): pool-7-thread-1 calls detatch()
08-22 14:18:34.391: D/cocos2d-x debug info(22654): Cocos2d-JS v3.14
08-22 14:18:34.391: D/BugrptJSExceptionHandler(22654): [registerJSExceptionHandler] begin ctx:0xeece8360
08-22 14:18:34.391: D/CocosBugrpt(22654): [initAndroidExceptinHandler] begin
08-22 14:18:34.391: D/JniHelper(22654): JniHelper::getJavaVM(), pthread_self() = -568846032
08-22 14:18:34.611: D/BugrptJSExceptionHandler(22654): [reportError] msg:mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
08-22 14:18:34.611: D/JniHelper(22654): JniHelper::getJavaVM(), pthread_self() = -568846032
08-22 14:18:34.611: D/BugrptJSExceptionHandler(22654): [sendAndroidJSReport] send exception begin
08-22 14:18:34.711: D/cocos2d-x(22654): create rendererRecreatedListener for GLProgramState
08-22 14:18:34.751: D/libGLESv2(22654): DTS_GLAPI : DTS is not allowed for Package : com.huidutek.sjmj
08-22 14:18:34.861: D/cocos2d-x debug info(22654): Success to load scene: db://assets/resources/scenes/loading.fire
08-22 14:18:34.891: D/cocos2d-x(22654): create rendererRecreatedListener for GLProgramState
08-22 14:18:34.901: D/cocos2d-x debug info(22654): getSchemeParame--------->Android
08-22 14:18:34.901: D/JniHelper(22654): JniHelper::getJavaVM(), pthread_self() = -568846032

帖子: 1

参与者: 1

阅读整个主题

关于 spine 的一些问题

$
0
0

@111861 写道:


编辑器里图片显示乱

浏览器里动画的头发不显示,使用mesh 就不能显示了吗

帖子: 2

参与者: 1

阅读整个主题

cocos2d-lua版本怎么没了


常驻节点做父节点

$
0
0

@ly13714214979 写道:

这个是我的节点,绑定成功后打印出来的节点内容有点问题子节点竟然都是空的,名字也是空的,cc.instantiate(xxx).parent=this.pnode;addChild会报错,有点紧急,还请各位大佬给指点一下

帖子: 5

参与者: 1

阅读整个主题

可以指导我搭建服务器吗?

cocoscreator在androidstudio打包失败

$
0
0

@evy_gyw 写道:

我按照官方的方式,直接在creator打包后在androidstuido运行,然后出现这样的错误。
我的环境,ndk r10e,jdk1.8,sdk 22的,so库有编译成功,我是新建一个helloworld项目进行编译的,是不是哪个步骤有问题?求教下,ndk尝试了12的都不行。

帖子: 1

参与者: 1

阅读整个主题

碰撞触发不了事件函数

$
0
0

@duanxun 写道:

前辈,我拉了两个精灵,加了下面的脚本,但是始终不触发函数
添加了PhysicsBoxColider,也按照要求分组打勾了 (范例里面不是这个组件名字,应该是1.6有变化)
请问我哪里出错了?

cc.Class({
extends: cc.Component,

properties: {
    // foo: {
    //    default: null,      // The default value will be used only when the component attaching
    //                           to a node for the first time
    //    url: cc.Texture2D,  // optional, default is typeof default
    //    serializable: true, // optional, default is true
    //    visible: true,      // optional, default is true
    //    displayName: 'Foo', // optional
    //    readonly: false,    // optional, default is false
    // },
    // ...
},

// use this for initialization
onLoad: function () {
    cc.director.getCollisionManager().enabled=true;
    cc.director.getCollisionManager().enabledDrawBoundingBox = true;



    console.log('loaded...');

},


onCollisionEnter: function (other, self) {
    //this.node.color = cc.Color.RED;
    console.log('on Enter...');

},

onCollisionStay: function (other) {
    // console.log('on collision stay');
    cc.log('zzz');
},

onCollisionExit: function () {
    console.log('zzzzzz');
},


// called every frame, uncomment this function to activate update callback
update: function (dt) {
    if ( this.node.name === "left"){
        this.node.x++;
    }else{
        this.node.x--;
    }

},

});

帖子: 1

参与者: 1

阅读整个主题

关于在浏览器上窗口大小改变的问题

$
0
0

@18581391615 写道:

正常情况下,当浏览器触发了window.onresize时ui会进行变化,可是当在ios sarfari的竖屏窗口大小改变时却没反应。就问有手动调用刷新UI的接口吗

帖子: 1

参与者: 1

阅读整个主题

Viewing all 91052 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>