Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Spriter General
    • Spriter
    • Help and Tutorials
  • Art Packs
    • Spriter Animated Art Packs
  • Developers
    • Spriter Implementations
    • Developer Help
  • General
    • Open Topic
    • Your Works
  • Jobs, Freelance, and Collaboration
    • Portfolios
    • Job offers (Paid)

Product Groups

  • Software
  • Animated Art Packs
  • Bundles
  • Environment Art Packs
  • 3D Art Packs

Categories

  • Software
    • 3rd Party Productivity Software
  • Paid Spriter Animations
    • Paid Spriter Art Pack Skins
  • Paid Environment Art
  • Free Spriter Animations
    • Free Art Pack Skins
  • Free Environment Art
  • 3D Art for games

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 5 results

  1. Hey guys, I've played around with Spriter on and off for a few years but never really done much with it, but recently I decided to try and throw something together to get an animation loaded and playing in pixi.js. After weeks of playing around and a bunch of googling, I have... something... but I'm not 100% sure what's wrong with my implementation here. Any pointers in the right direction would be great! Everything seems offset by 180 degrees, not entirely sure why though. Arms and legs appear to be positioned on the opposite sides. Hands and feet are attached to the wrong appendages. Interpolating between the first and second keyframes causes all object to scale and rotate in a bizarre (but consistent) manner, all other frames play as expected given the above issues. Given the last point, I'm making a major assumption my my interpolation methods are all working fine and this is just a display-specific set of issues (I get the same even if I just return the state of the first keyframe never update the animation state). From my searches and some experimentation I've made a few other assumptions: All bones excluding the first bone in the bone_refs array have their parent's transform values applied to them. All object_refs have the parent bone transform values applied. All Sprites have the same physical parent (flattened scene graph). I've used the SpriterDotNet repo too to try and help me solve some problems but I'm not sure it will help solve the problems I currently face. I also tried playing around with the existing spriter.js and spriter.ts implementations but I couldn't even get the demo loading and running; looking at the demo source there's also a hell of a lot of set up and not even sure how much of it is even necessary to get something working. Here's my function that applies the parent bone state to the children (bones, objects): private applyParentProps(child: IBoneState | ISpriteState, parent: IBoneState): void { const x = child.x * parent.scale_x; const y = child.y * parent.scale_y; const parentAngle = fromDegrees(parent.angle); const sin = Math.sin(parentAngle); const cos = Math.cos(parentAngle); child.x = ((x * cos) - (y * sin)) + parent.x; child.y = ((x * sin) - (y * cos)) + parent.y; child.scale_x *= parent.scale_x; child.scale_y *= parent.scale_y; if (child.angle != null) { child.angle = Math.sign(parent.scale_x * parent.scale_y) * (child.angle + parent.angle) % 360; } } This just manipulates the data structure for the child. For the objects (Sprites), I use this method to handle applying that data structure: private applyState(component: Component, state: ISpriteState): void { // `this._bones` is just the array of bone data interpolated for the current time. // `state` is the object data interpolated for the current frame. this.applyParentProps(state, this._bones[state.parent]); component.position.set(state.x, state.y); component.scale.set(state.scale_x, state.scale_y); if (state.z_index != null) { component.zIndex = state.z_index; } if (state.angle != null) { component.rotation = fromDegrees(state.angle); } // Update the texture. if (state.file != null && state.folder != null) { const fileData = SpriterCache.getFile(state.folder, state.file); if (component.name !== fileData.name) { component.name = fileData.name; component.texture = TextureCache[fileData.name]; component.width = fileData.width; component.height = fileData.height; component.pivot.set( fileData.pivot_x * fileData.width, fileData.pivot_y * fileData.height ); } } } Am I missing something super obvious? Am I being dumb here? Thanks in advance
  2. Gdevelop can use JavaScript code events. So, surely theres a way to bring Spriter to life in Gdevelop? If so please post how to.
  3. Hi there, I'm currently trying to work with the .scon (json) file type that Spriter exports and I'm slightly confused by some of it's translation... Q: (Using Spriter release 11) - For the root bone, the X & Y positions found in the timeline array are the same as in the editor. - However the child bones X&Y position in the .scon seem to be very different to the editor and I can't figure out if the position is relative to the end X&Y of the parent/root bone? Or something else. any info on that would be great! Let me know if you need an aditional info/pics I'm finding the bone info under: entity[0].animation[0].timeline[0].key[0].bone.angle Thanks, Clym
  4. Hi everyone! My main question: has anyone experience in crosscompiling the runtime to JS by GWT with gradle? I have a class, SpriterScreen, which I pasted below. In the class I put more/less the content of one of trixt0r's testclasses,com.brashmonkey.spriter.tests.backend.LibGdxTest, for the libGdx runtime. I had refactor it to fit in a Screen. When I want to crosscompile this class with GWT by the gradle-Task gradlew html:sperdev I get compiler errors. I copied them below the origination class. package net.systemexklusive.site.app.screens;import com.badlogic.gdx.Gdx;import com.badlogic.gdx.Screen;import com.badlogic.gdx.files.FileHandle;import com.badlogic.gdx.graphics.GL20;import com.badlogic.gdx.graphics.OrthographicCamera;import com.badlogic.gdx.graphics.g2d.Sprite;import com.badlogic.gdx.graphics.g2d.SpriteBatch;import com.badlogic.gdx.graphics.glutils.ShapeRenderer;import com.brashmonkey.spriter.Data;import com.brashmonkey.spriter.Drawer;import com.brashmonkey.spriter.Player;import com.brashmonkey.spriter.SCMLReader;import com.brashmonkey.spriter.libGdx.LibGdxDrawer;import com.brashmonkey.spriter.libGdx.LibGdxLoader;import net.systemexklusive.site.SysExApp;/* Error is in the show-method */public class SpriterScreen implements Screen {Player player;ShapeRenderer renderer;SpriteBatch batch;Drawer<Sprite> drawer;LibGdxLoader loader;OrthographicCamera cam;@Overridepublic void show() {cam = new OrthographicCamera();cam.zoom = 1f;renderer = new ShapeRenderer();batch = new SpriteBatch();FileHandle handle = Gdx.files.internal("monster/basic_002.scml");Data data = new SCMLReader(handle.read()).getData();loader = new LibGdxLoader(data);/* ---- The line below is responsible for the crosscompiler Error --- */loader.load(handle.file());drawer = new LibGdxDrawer(loader, batch, renderer);player = new Player(data.getEntity(0));}@Overridepublic void render(float delta) {}@Overridepublic void resize(int width, int height) {cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());cam.position.set(0, 0, 0f);cam.update();renderer.setProjectionMatrix(cam.combined);batch.setProjectionMatrix(cam.combined);}@Overridepublic void pause() {}@Overridepublic void resume() {}@Overridepublic void hide() {}@Overridepublic void dispose() {renderer.dispose();loader.dispose();}} Here is a snippet of the console out triggered by 'gradlew html:superDev' 17:25:28.124 [QUIET] [system.out] Compiling module net.systemexklusive.site.GdxDefinitionSuperdev17:25:30.789 [QUIET] [system.out] Validating units:17:25:30.790 [QUIET] [system.out] Ignored 2 units with compilation errors in first pass.Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.17:25:32.755 [QUIET] [system.out] D:\coding\libGdx\IdeaProjects\SysExSiteGame\html\.17:25:32.755 [QUIET] [system.out] ../android/assets17:25:32.758 [QUIET] [system.out] Copying resources from ../android/assets to war/17:25:32.759 [QUIET] [system.out] D:\coding\libGdx\IdeaProjects\SysExSiteGame\html\..\android\assets17:25:32.759 [QUIET] [system.out] D:\coding\libGdx\IdeaProjects\SysExSiteGame\html\assets17:25:33.149 [QUIET] [system.out] [ERROR] Errors in 'file:/D:/coding/libGdx/IdeaProjects/SysExSiteGame/core/src/net/systemexklusive/site/app/screens/SpriterScreen.java'17:25:33.150 [QUIET] [system.out] [ERROR] Line 56: The method file() is undefined for the type FileHandle17:25:33.155 [QUIET] [system.out] Computing all possible rebind results for 'com.badlogic.gwtref.client.IReflectionCache'17:25:33.155 [QUIET] [system.out] Rebinding com.badlogic.gwtref.client.IReflectionCache17:25:33.156 [QUIET] [system.out] Invoking generator com.badlogic.gwtref.gen.ReflectionCacheGenerator17:25:33.157 [QUIET] [system.out] com.badlogic.gwtref.client.IReflectionCache17:25:33.651 [QUIET] [system.out] java.lang.Double17:25:33.652 [QUIET] [system.out] double Somehow it complains that the FileHandle has no file()-Method. But as I understand, the runtime and the libGdx-Type are about the java.io.File. I put the runtime sources in the core-module and expanded the xxx.gwt.xml. Can anyone give me some hints? This would be great because I struggling with this build for quite a while now and I'd really like to see the anims on a browser! Thank you
  5. Hello. How can I use the finished animation in my project on phaser (pixi.js / javascript) ??? I save the animation in three files, atlas.png, atlas.json, skeleton.scon. Thank U
×
×
  • Create New...