Ecco

Members
  • Content count

    5
  • Joined

  • Last visited

  1. ..hi guys.. Im following tutorials from here http://pixijs.io/examples/#/basics/basic.js and i cant see any examples with how to load/manage sound in PIXI. Can you point me in right direction, please. EDIT: I got it here..http://pixijs.io/pixi-sound/examples/index.html
  2. ..Spine character mirroring..

    ..thank you man.. ..
  3. ..Spine character mirroring..

    ..hi guys.. ...what would be a way to 'mirror' Spine created character ?? Basically if character need to move right-left, how would i flip it so its facing direction of motion(along X axis) ??
  4. hi Ivan. Well...how to say this..it works, and it doesn't work at all (everything stuck/freeze), which is a random thing. I thought its because im trying to access loaded entity handler, before is actually loaded. So, i have created new loader for every loaded spine animation and added 'once' so i will trace when its actually loaded ANIMATION_LOADER.push(new PIXI.loaders.Loader()); ANIMATION_LOADER[ANIMATION_LOADER.length-1].add('character', spineJSON_filename).load(onAssetsLoaded).once('complete',this.complete,this); ..so, onAssetsLoaded looks like this function onAssetsLoaded(loader,resources) { ANIMATION_SPINE.push(new PIXI.spine.Spine(resources.character.spineData)); ANIMATION_SPINE[ANIMATION_SPINE.length-1].skeleton.setSlotsToSetupPose(); ANIMATION_SPINE[ANIMATION_SPINE.length-1].skeleton.setSkinByName(ANIMATION_DEFAULT_SKIN); ANIMATION_SPINE[ANIMATION_SPINE.length-1].x = 100;//RND(100,window.innerWidth+100); ANIMATION_SPINE[ANIMATION_SPINE.length-1].y = RND(280,window.innerHeight-250); ANIMATION_SPINE[ANIMATION_SPINE.length-1].scale.set(1.0); ANIMATION_SPINE[ANIMATION_SPINE.length-1].state.setAnimation(0, 'walk', true); GAME.stage.addChild(ANIMATION_SPINE[ANIMATION_SPINE.length-1]); } and function complete looks like function complete(loader,resources) { ANIMATION_IS_LOADED.push(true); } ..so, im using ANIMATION_IS_LOADED , which has same index as ANIMATION_SPINE to track is it loaded or not, before i can access animation handle. Function for setting position, im calling in a game loop, looks like this function ANIMATION_SET_POSITION(characterID,x_,y_) { if(ANIMATION_IS_LOADED[characterID]) { ANIMATION_SPINE[characterID].x=x_; ANIMATION_SPINE[characterID].y=y_; } } ..so, this, sort of fixed my problem...however, i would like to know, what would be another way to know for sure that whatever is thrown at loader is actually loaded ? What would be other method of loading media, kind a 'manually' where program will not go on to next instruction until is previous one completed(media loaded) ??
  5. Hi guys.. Im trying to load multiple SPINE animations and each store in an array. Problem is that, i cant access loaded SPINE animations created as an array inside onAssetsLoaded function. Arrays are defined outside of onAssetsLoaded function, which is why im confused. Here it is.. var ANIMATION_SPINE=[]; //declared outside of any function ..then i load animated character like this, PIXI.loader.add('character', spineJSON_filename).load(onAssetsLoaded); ..and onAssetsLoaded function looks like this.. function onAssetsLoaded(loader,res) { ANIMATION_SPINE.push(new PIXI.spine.Spine(res.character.spineData)); ANIMATION_SPINE[ANIMATION_SPINE.length-1].skeleton.setSkinByName( 'skin1'); ANIMATION_SPINE[ANIMATION_SPINE.length-1].x = 600; ANIMATION_SPINE[ANIMATION_SPINE.length-1].y = 600; ANIMATION_SPINE[ANIMATION_SPINE.length-1].skeleton.setSlotsToSetupPose(); ANIMATION_SPINE[ANIMATION_SPINE.length-1].scale.set(1.0); ANIMATION_SPINE[ANIMATION_SPINE.length-1].state.setAnimation(0, 'walk', true); GAME.stage.addChild(ANIMATION_SPINE[ANIMATION_SPINE.length-1]); } ..after this, i see my character on the screen and its properly animated..however, i cant access ANIMATION_SPINE (i want to change animations, or skins, etc, in runtime) array outside of onAssetsLoaded() even its declared outside of any function..how to do this? How to store animations inside array from where i can access them globally ?? Thank you in advance guys.