Giter Club home page Giter Club logo

spriterhaxeengine's Issues

add Context to Spriter/Libraries

Context could allow to let users define specific shader or other custom data to a Spriter character and use it in their custom Rendering Libraries.

Compatibility problem with haxe 3.4.0

The following error is not letting me compile using the latest Haxe:

C:/HaxeToolkit/haxe/lib/SpriterHaxeEngine/2,0,0/spriter/definitions/Metaline.hx:9: characters 9-38 : Warning : Structures with new are deprecated, use haxe.Constraints.Constructible instead

Flip Animation

Hello,

I'm trying to implement spriter with HaxeFlixel using SpriterHaxeEngine.
The problem I encountered is that I can't flip the spriter sprites.

I tried this:

if (flipX)
{
//spriterAnims.info.scaleX = -1;
spriterAnims.info.scaleY = -1;
}
else
{
//spriterAnims.info.scaleX = 1;
spriterAnims.info.scaleY = 1;
}

But id does crazy things. Is there any solution?

pooling

Pooling will be a great improvement. I began to implement it (5443ab4)

When all objects that are instanciated many times per frames will be ready for pooling, it will be great to use typedef or something else to fallback to a specific pooling system from a framework (flixel, flambe, etc.)

cannot tileImages with TileLayerLib when targeing Windows, or Android

example---
If you try to put spriter objects side by side like in a tile map on windows or android. you will see a noticeable gap between the images. publishing to htlm5 or flash does not have this problem.

I have tested this with bitmapLib and SimpleBitmapLib. and they work fine. the problems seems to only occur when using the TilelayerLib

Placement is off.

Placement is off. It's consistently off on all targets (Neko, HTML5, CPP) except Flash, where it's still off by a pixel but to the right instead of the left. It may not make a difference in large images, but in pixel art, being off by one pixel is a lot.

This happens on both the SpriterLibrary and the FlixelLibrary so I don't think it has anything with the library implementation.

http://i.imgur.com/az53Euf.png
az53euf

Cannot get the points of an entity

I'm using this code to get the spriter:

            headSpriter = PlayState.instance.engine.addSpriter("head",X,Y);
    headSpriter.info.x = FlxG.width *0.75;
    headSpriter.info.y = -FlxG.height * 0.75;

To play:

    headSpriter.playAnimFromEntity("cabeza", "transicionAIdleCabeza", toIdleAnim, true);

On update I want to get the list of points and place eyes over them:

    var points:Array<SpatialInfo> = headSpriter.getPoints();
    var point:SpatialInfo;
    for (i in 0...points.length)
    {
        point = points[i];
        var eye = arrayEyes[i];
        eye.setPosition( point.x,   point.y);
    }

But the eyes are not showing where they suppose to go.

Some bone animations explode

I think this is derived from bug #23

I made a demo with a stripped version of the platformer I'm making to test the animations using HaxeFlixel and the demo animations from spriter:

https://dl.dropboxusercontent.com/u/24695185/HaxeFlixelSpriterTest.rar

Some of the animations "explode" when are playing.

For the project I'm using the latest dev flixel and SpriterHaxeEngine. Notice that I added _dev to the names of the libraries.

@sruloart, maybe we can use this demo for HaxeFlixel when the issues are fixed?

add scml b7 support

This engine is compatible with scml made with Spriter b6.1.
It needs now compatibility with scml b7 since Brashmonkey released a new version of Spriter few days ago.

Easing tween implementation?

Hi! While playing around with a test animation, I noticed that the the easing tween between frames in Spriter aren't working/implemented yet. Animation tweens only play in a linear way.

Curve Type of Key inside Mainline is not Loaded

curveType is only loaded when the <key> is inside <timeline>.

When curveType is inside <mainline>, it isn't loaded. EDIT: and the curveType follows the one specified in <key> inside <timeline>.

Version of runtime: haxelib

EDIT: interestingly, curveType of MainlineKey isn't specified in the scml reference. But the editor is generating mainline key with curveType as of R5. And the behavior of the editor is that the curveType of MainlineKey overrides TimelineKey. Maybe time to ask the guys in BrashMonkey for explanation?

EDIT: I've checked their C++ reference implementation. Their MainlineKey has a TimeInfo, which has an EasingCurveInterface. Their EasingCurveInterface is inherited by implementation of curve, such as InstantEasingCurve and CubicEasingCurve. Therefore, their MainlineKey is indeed capable for storing curveType. Maybe their scml documentation is outdated?

Cache SCML's to binary to save loading time (if that's possible)

Like this Bardbarian's guys trick (later in the thread): http://forum.starling-framework.org/topic/json-or-xml: "what we did with Bardbarian: With over 30 SCML files to load, it was starting to get really slow. So we just added some code to our startup, to cache them all in a binary file.
Just make a big hash of all your StarlingAnimation instances, then use writeObject to store in a bytearray, and save to a little file "animations.bin".
When on the device, load the bin file, and extract each animation. Load times go from like 3000ms, to 10ms [:D]

WRITE:
var f:File = AirUtils.projectFolder.resolvePath("src/assets/spriter/scmlCache.bin");
var ba:ByteArray = new ByteArray();
ba.writeObject({sd: animationsByName, hd: animationsByNameHd});
ba.compress();

var fs:FileStream = new FileStream();
fs.open(f, FileMode.WRITE);
fs.writeBytes(ba, 0, ba.bytesAvailable);
fs.close();

READ:
var ba:ByteArray = new ByteArray();
var stream:FileStream = new FileStream();
stream.open(cacheFile, FileMode.READ);
stream.readBytes(ba, 0, stream.bytesAvailable);
stream.close();
ba.uncompress();
animationsByName = scale == 1? ba.readObject().hd : ba.readObject().sd; "

<FIX> extra bracket causing case not found.SpriterAnimation.hx line 75

public function setCurrentTime(newTime:Int, library:AbstractLibrary, root:IScml):Void
{
var currentTime:Int;
var loop:Int;
switch(loopType)
{
case LOOPING:
loop = Std.int(newTime / length);
currentTime = newTime % length;
//callback
if (loop == 1){ <---remove bracket------!!!!!!!!!!
root.onEndAnim(name);

    case NO_LOOPING:
        currentTime = Std.int(Math.min(newTime, length));
        //callback
        if (currentTime == length)
            root.onEndAnim(name);
    }

addParticule (unique anim without loadings others from the SpriterEntity obj)

I use Spriter only for particules in my game, so in my SCML file, I have juste one entity with all the particules animations.

When I add an particule to the game (new Spriter obj to the SpriterEngine obj), I suppose creating a particule (new Spriter obj) copy all the SCML animations just for using one of them.

What do you think of the possibility to create a light particule Spriter obj with a unique specified animation (with autoDestroy boolean parameter) ?

Maybe like that :

function addParticule(_entity:String, _animation:String, _autoDestroy:Bool):Spriter
{}

Animation of Subentities aren't played

Reference file for reproducing the bug is available here

Expected output of engine.getEntity('test').playAnimFromEntity('scene', 'MoveAnimation') (Due to technical issue, the gif below is playing slower than it should):

However, the runtime cannot animate the subentities. Here is the actual output

Notice that the blue balls don't rotate as it should.

proposition : adding alpha with BitmapLibrary.hx

not very optimised, but it can make the deal in some cases :

if(spatialResult.angle == 0 && spatialResult.scaleX == 1 && spatialResult.scaleY == 1 && spatialResult.a==1)
{
_point.x = spatialResult.x;
_point.y = spatialResult.y;
_canvas.copyPixels(bmp, bmp.rect, _point,true);
}
else
{
_matrix.identity();
_matrix.scale(spatialResult.scaleX, spatialResult.scaleY);
_matrix.rotate(SpriterUtil.toRadians(SpriterUtil.fixRotation(spatialResult.angle)));
_matrix.translate(spatialResult.x, spatialResult.y);
_canvas.draw(bmp, _matrix, new ColorTransform(1,1,1,spatialResult.a), null, null, true);
}

playAnimsStack problem when using looping animation

When using a looping animation in a sequence of animations with playAnimsStack(), the transition is not smooth. However the very same sequence with the animation set to looping false is smooth.

So we need to see why the transition is incorrect between a looping animation and an other animation on the playAnimsStack function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.