use of com.esotericsoftware.spine.SkeletonRenderer in project bladecoder-adventure-engine by bladecoder.
the class SpineRenderer method retrieveAssets.
@Override
public void retrieveAssets() {
renderer = new SkeletonRenderer();
renderer.setPremultipliedAlpha(false);
bounds = new SkeletonBounds();
for (String key : sourceCache.keySet()) {
if (sourceCache.get(key).refCounter > 0)
retrieveSource(key, ((SkeletonCacheEntry) sourceCache.get(key)).atlas);
}
if (currentAnimation != null) {
SkeletonCacheEntry entry = (SkeletonCacheEntry) sourceCache.get(currentAnimation.source);
currentSource = entry;
// Stop events to avoid event trigger
boolean prevEnableEvents = eventsEnabled;
eventsEnabled = false;
setCurrentAnimation();
eventsEnabled = prevEnableEvents;
} else if (initAnimation != null) {
startAnimation(initAnimation, Tween.Type.SPRITE_DEFINED, 1, null);
}
}
use of com.esotericsoftware.spine.SkeletonRenderer in project skin-composer by raeleus.
the class Main method create.
@Override
public void create() {
appFolder = Gdx.files.external(".skincomposer/");
skin = new FreeTypeSkin(Gdx.files.internal("skin-composer-ui/skin-composer-ui.json"));
viewport = new ScreenViewport();
// viewport.setUnitsPerPixel(.5f);
var batch = new PolygonSpriteBatch(SPINE_MAX_VERTS);
stage = new Stage(viewport, batch);
Gdx.input.setInputProcessor(stage);
shapeDrawer = new TinyVGShapeDrawer(stage.getBatch(), skin.getRegion("white"));
graphDrawer = new GraphDrawer(shapeDrawer);
tinyVGAssetLoader = new TinyVGAssetLoader();
skeletonRenderer = new SkeletonRenderer();
var skeletonJson = new SkeletonJson(Main.skin.getAtlas());
floppySkeletonData = skeletonJson.readSkeletonData(Gdx.files.internal("spine/floppy.json"));
floppyAnimationStateData = new AnimationStateData(floppySkeletonData);
uiScaleSkeletonData = skeletonJson.readSkeletonData(Gdx.files.internal("spine/uiscale.json"));
uiScaleAnimationStateData = new AnimationStateData(uiScaleSkeletonData);
textraTypistLogoSkeletonData = skeletonJson.readSkeletonData(Gdx.files.internal("spine/TextraTypist Logo.json"));
textraTypistLogoAnimationStateData = new AnimationStateData(textraTypistLogoSkeletonData);
arrowSkeletonData = skeletonJson.readSkeletonData(Gdx.files.internal("spine/arrow-animation.json"));
arrowAnimationStateData = new AnimationStateData(arrowSkeletonData);
cursorNE = Utils.textureRegionToCursor(skin.getRegion("cursor_resize_ne"), 16, 16);
cursorNW = Utils.textureRegionToCursor(skin.getRegion("cursor_resize_nw"), 16, 16);
cursorVertical = Utils.textureRegionToCursor(skin.getRegion("cursor_resize_vertical"), 16, 16);
cursorHorizontal = Utils.textureRegionToCursor(skin.getRegion("cursor_resize_horizontal"), 16, 16);
initDefaults();
populate();
resizeUiScale(projectData.getUiScale());
}
use of com.esotericsoftware.spine.SkeletonRenderer in project WakgoodFanGame by Bafguit.
the class Labyrintale method create.
@Override
public void create() {
Gdx.graphics.setResizable(false);
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
// Gdx.graphics.setWindowedMode(DEFAULT_WIDTH, DEFAULT_HEIGHT);
camera = new OrthographicCamera();
camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
sb = new SpriteBatch();
psb = new PolygonSpriteBatch();
sr = new SkeletonRenderer();
sr.setPremultipliedAlpha(true);
inputHandler = new InputHandler();
fileHandler = new FileHandler();
fontHandler = new FontHandler();
settingHandler = new SettingHandler();
actionHandler = new ActionHandler();
effectHandler = new EffectHandler();
groupHandler = new GroupHandler();
game = this;
mainMenuScreen = new MainMenuScreen();
charSelectScreen = new CharSelectScreen();
advisorSelectScreen = new AdvisorSelectScreen();
// labyrinth = new AbstractLabyrinth();
fadeTex = FileHandler.FADE;
fadeTex.setPosition(0, 0);
setScreen(mainMenuScreen);
}
Aggregations