Package com.badlogic.gdx.graphics.g2d

Examples of com.badlogic.gdx.graphics.g2d.TextureAtlas


    debugRenderer = new SkeletonRendererDebug();
    debugRenderer.setMeshTriangles(false);
    debugRenderer.setRegionAttachments(false);
    debugRenderer.setMeshHull(false);

    atlas = new TextureAtlas(Gdx.files.internal("raptor/raptor.atlas"));
    SkeletonJson json = new SkeletonJson(atlas); // This loads skeleton JSON data, which is stateless.
    json.setScale(0.5f); // Load the skeleton at 50% the size it was in Spine.
    SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("raptor/raptor.json"));

    skeleton = new Skeleton(skeletonData); // Skeleton holds skeleton state (bone positions, slot attachments, etc).
View Full Code Here


    batch = new SpriteBatch();
    renderer = new ShapeRenderer();
    skeletonRenderer = new SkeletonRenderer();
    skeletonRenderer.setPremultipliedAlpha(true);

    atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));

    // This loader creates Box2dAttachments instead of RegionAttachments for an easy way to keep
    // track of the Box2D body for each attachment.
    AtlasAttachmentLoader atlasLoader = new AtlasAttachmentLoader(atlas) {
      public RegionAttachment newRegionAttachment (Skin skin, String name, String path) {
View Full Code Here

    String atlasFileName = skeletonFile.nameWithoutExtension();
    if (atlasFileName.endsWith(".json")) atlasFileName = new FileHandle(atlasFileName).nameWithoutExtension();
    FileHandle atlasFile = skeletonFile.sibling(atlasFileName + ".atlas");
    if (!atlasFile.exists()) atlasFile = skeletonFile.sibling(atlasFileName + ".atlas.txt");
    TextureAtlasData data = !atlasFile.exists() ? null : new TextureAtlasData(atlasFile, atlasFile.parent(), false);
    TextureAtlas atlas = new TextureAtlas(data) {
      public AtlasRegion findRegion (String name) {
        AtlasRegion region = super.findRegion(name);
        return region != null ? region : fake;
      }
    };
View Full Code Here

    batch = new PolygonSpriteBatch();
    renderer = new SkeletonRenderer();
    renderer.setPremultipliedAlpha(true);

    {
      TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));
      SkeletonJson json = new SkeletonJson(atlas);
      json.setScale(0.6f);
      SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));
      spineboy = new Skeleton(skeletonData);
      spineboy.setPosition(320, 20);

      AnimationStateData stateData = new AnimationStateData(skeletonData);
      stateData.setMix("walk", "jump", 0.2f);
      stateData.setMix("jump", "walk", 0.2f);
      spineboyState = new AnimationState(stateData);
      new AnimationStateAdapter() {
        public void start (int trackIndex) {
          spineboyState.addAnimation(0, "walk", true, 0);
          spineboyState.addAnimation(0, "jump", false, 3).setListener(this);
        }
      }.start(0);
    }

    {
      TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("goblins/goblins-ffd.atlas"));
      SkeletonJson json = new SkeletonJson(atlas);
      SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("goblins/goblins-ffd.json"));
      goblin = new Skeleton(skeletonData);
      goblin.setSkin("goblin");
      goblin.setSlotsToSetupPose();
View Full Code Here

    renderer.setPremultipliedAlpha(true);
    debugRenderer = new SkeletonRendererDebug();
    debugRenderer.setBoundingBoxes(false);
    debugRenderer.setRegionAttachments(false);

    atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));
    SkeletonJson json = new SkeletonJson(atlas); // This loads skeleton JSON data, which is stateless.
    json.setScale(0.6f); // Load the skeleton at 60% the size it was in Spine.
    SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));

    skeleton = new Skeleton(skeletonData); // Skeleton holds skeleton state (bone positions, slot attachments, etc).
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.g2d.TextureAtlas

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.