watson

  • 31 mai 2016
  • Inscrit 5 sept. 2013
  • I need the lua runtime, but it always late to update.
    Can you help me to update the lua runtime version?

  • If I set the the bone scale x and y to zero, all children scale in animation will failed.
    It break many of our animations that run OK on spine1.9.x
    Can you fix it, it is so important.


    I find the bug in runtime about '_spScaleTimeline_apply':
    The old version has some code:
    if (time >= self->frames[self->framesCount - 3]) { /* Time is after last frame. */
    bone->scaleX += (bone->data->scaleX - 1 + self->frames[self->framesCount - 2] - bone->scaleX) * alpha;
    bone->scaleY += (bone->data->scaleY - 1 + self->frames[self->framesCount - 1] - bone->scaleY) * alpha;
    return;
    }

    But right now it changed into:
    if (time >= self->frames[self->framesCount - 3]) { /* Time is after last frame. */
    bone->scaleX += (bone->data->scaleX * self->frames[self->framesCount - 2] - bone->scaleX) * alpha;
    bone->scaleY += (bone->data->scaleY * self->frames[self->framesCount - 1] - bone->scaleY) * alpha;
    return;
    }

  • The libgdx format does not support compress texture format like pvr or ect1.
    I need to reduce my texture size and try to use the compress format in cocos2d-x, but the original runtime seems does not support it.
    BTW, the cocos2d-x runtime loading API is not thread safe so I can not loading my resource on other thread.
    Hope it could be resolved/

    Thanks~~

  • I want to scale a Magic Circle and rotate it.
    The magic circle image original looks like this:
    http://dl.zhishi.sina.com.cn/upload/23/ ... 147212.gif
    I want to scale it and rotate it, make an magic effect.
    But for this limit, it seems can not implement.

    How can I do it?

  • I have a cycle image, I want it squeeze and rotation the image with an animation.
    I build two bones, the parent bone set the scale Y to 0.3, the the child bone set rotation, but the result is wrong.
    I change the way, rotation the image but not the bone, the result is correct.

  • We purchase the essential version of spine, but we found the professional version has powerful feature include mesh, IK and skin.
    But I read the runtime code, can not find any support for them.
    We are using cocos2d-x to build a game, we hope the professional version can provide the runtime support.

    If we buy the professional version, there will be a new runtime for download?
    If we buy a professional version, the prevse buying essential version is useless, is there any way to "upgrade" it?

    Thank you!!

  • I export a skeleton with spine, but the texture the artist use have large blank border. When I using texture packer to combine all the images into one, I use trim mode, which will compress all the border, and store in texture frame data.
    When I load it into the spine actionscript runtime, It show very strange. I put the resource file and screenshot in the attachment.

    My test code is just modify the starling example:

    [Embed(source = "test.xml", mimeType = "application/octet-stream")]
    static public const SpineboyAtlasXml:Class;
    
    [Embed(source = "test.png")]
    static public const SpineboyAtlasTexture:Class;
    
    [Embed(source = "tes.json", mimeType = "application/octet-stream")]
    static public const SpineboyJson:Class;
    
    // ...
    
    public function Game () {
    	// ...
    	skeleton = new SkeletonAnimation(skeletonData);
    	skeleton.setAnimationStateData(stateData);
    	skeleton.skeleton.skinName = "0002";
    	skeleton.skeleton.setToSetupPose();
    	skeleton.x = 320;
    	skeleton.y = 820;
    	skeleton.setAnimation("walk", true);
    	skeleton.addAnimation("hit", false, 3);
    	skeleton.addAnimation("walk", true);
    
    addChild(skeleton);
    Starling.juggler.add(skeleton);
    }
    

    If I using the No trim mode to process the images, and keep the blank border inside the texture, It will be OK. I find the starling AttachmentLoader code:

    switch (type) {
    	case AttachmentType.region:
    		var regionAttachment:RegionAttachment = new RegionAttachment(name);
    
    	var texture:Texture = Cvar.rdFactory.CreateTexture(_prefix + name);
    	if (texture)
    	{
    		var frame:Rectangle = texture.frame;
    		texture = Texture.fromTexture(texture); // Discard frame.
    		regionAttachment.rendererObject = new SkeletonImage(texture);
    		regionAttachment.regionOffsetX = frame.x;
    		regionAttachment.regionOffsetY = frame.y;
    		regionAttachment.regionWidth = frame.width;
    		regionAttachment.regionHeight = frame.height;
    		regionAttachment.regionOriginalWidth = texture.width;
    		regionAttachment.regionOriginalHeight = texture.height;
    			
    		return regionAttachment;
    	}
    	else
    	{
    		return null;
    	}
    case AttachmentType.boundingbox:
    	return new BoundingBoxAttachment(name);
    }
    
    throw new Error("Unknown attachment type: " + type);
    

    Which store the frame data into the RegionAttachment, and process them in function: RegionAttachment.updateOffset.
    I view many other language runtime, the algorithm do the same thing. I want to know it there any bug in this function, or I miss something?

  • Will I think I am finish the modify for action script runtime, add a new attachment for a skeleton. Can I fork the respo and send a pull request, I hope it could be accepted, do not want to always change my code when the official version is update.

  • For example I have a character with many weapon, and each weapon have two part: left-hand and right-hand.
    I create multi project, the character without weapon is one project, and each weapon has a project.

    The character has two specify bone which named "left hand" and "right hand"
    In each weapon, under the root bone, have two bone named "left hand weapon" and "right hand weapon". The weapon may have it's own animations, need to play separately. For instance a hunter hold a bow, when he play attack animation, the bow need play at the same time.

    I want to load the weapon project, and attach the left-hand and right-hand bone under the character project, just like many 3D game skeleton system do.

    I look through the API document but no good idea. Is there any way to achieve that?

    And I want to request whether to add a feature, that user can load an external spine project into this project, attach it under a slot as an attachment.
    It will useful if the character need to change cloth, some cloth has many frame animation to present the wind blow the cloth, but some cloth like armor is just an image. Current the spine support frame animation but in embed into the animation timeline. If I have a walk animation, I need build the frame animation inside the walk animation, so I need the create the animation for each type of cloth.

    May be there have some other way to solve this problem elegant, for I am a newbie of spine, I am not quite sure whether I am right.

    I am add a SkeletonAttachment as a subclass of Attachment in actionscript code:

    package spine.starling
    {
        import spine.attachments.Attachment;
        import spine.starling.SkeletonAnimation;
        
    public class SkeletonAttachment extends Attachment { private var _skeletion:SkeletonAnimation; public function SkeletonAttachment(name:String, skeletion:SkeletonAnimation) { super(name); _skeletion = skeletion; } public function set skeletion(skeletion:SkeletonAnimation):void { _skeletion = skeletion; } public function get skeletion():SkeletonAnimation { return _skeletion; } } }

    And I modify the SkeletonSprite render function:

    override public function render (support:RenderSupport, alpha:Number) : void {
    		alpha *= this.alpha * skeleton.a;
    		var drawOrder:Vector.<Slot> = skeleton.drawOrder;
    		for (var i:int = 0, n:int = drawOrder.length; i < n; i++) {
    			var slot:Slot = drawOrder[i];
    			var regionAttachment:RegionAttachment = slot.attachment as RegionAttachment;
    			if (regionAttachment != null) {
    				var vertices:Vector.<Number> = this.vertices;
    				regionAttachment.computeWorldVertices(skeleton.x, skeleton.y, slot.bone, vertices);
    				var r:Number = skeleton.r * slot.r * 255;
    				var g:Number = skeleton.g * slot.g * 255;
    				var b:Number = skeleton.b * slot.b * 255;
    				var a:Number = slot.a;
    				var rgb:uint = Color.rgb(r,g,b);
    
    			var image:SkeletonImage = regionAttachment.rendererObject as SkeletonImage;
    			var vertexData:Vector.<Number> = image.vertexData.rawData;
    					
    			image.vertexData.setPosition(0, vertices[2], vertices[3]);				
                image.vertexData.setColor(0, rgb);
                image.vertexData.setAlpha(0, a);
    			
    			image.vertexData.setPosition(1, vertices[4], vertices[5]);
                image.vertexData.setColor(1, rgb);
                image.vertexData.setAlpha(1, a);
    			
    			image.vertexData.setPosition(2, vertices[0], vertices[1]);
                image.vertexData.setColor(2, rgb);
                image.vertexData.setAlpha(2, a);
    			
    			image.vertexData.setPosition(3, vertices[6], vertices[7]);
                image.vertexData.setColor(3, rgb);
                image.vertexData.setAlpha(3, a);
    
    			image.updateVertices();
    			support.blendMode = slot.data.additiveBlending ? BlendMode.ADD : BlendMode.NORMAL;
    			support.batchQuad(image, alpha, image.texture);
    		}
            else
            {
                var skeletonAttachment:SkeletonAttachment = slot.attachment as SkeletonAttachment;
                if (skeletonAttachment != null) {
                    var skt:SkeletonAnimation = skeletonAttachment.skeletion;
                    
                    if (skt.hasVisibleArea)
                    {
                        skt.x = slot.bone.worldX;
                        skt.y = slot.bone.worldY;
                        skt.rotation = slot.bone.worldRotation * (3.1415926) / 180;
                        skt.scaleX = slot.bone.worldScaleX;
                        skt.scaleY = slot.bone.worldScaleY;
                        
                        skt.alpha = slot.a;
                        
                        var filter:FragmentFilter = skt.filter;
                        
                        support.pushMatrix();
                        support.transformMatrix(skt);
                        support.blendMode = skt.blendMode;
                        
                        if (filter) filter.render(skt, support, alpha);
                        else        skt.render(support, alpha);
                        
                        support.blendMode = blendMode;
                        support.popMatrix();
                    }
                }
            }
    	}
    }
    

    Hope for response, Thanks!

  • I am using the spine, each time I need export data by my hand.
    I hope to write a script to process each .spine file to automatic export, but I can not find a way to use command line.
    It really necessary.