2013-10-21 5 views
0

스프라이트 시트를 가지고 있기 때문에 거의 모든 곳을 찾지도 않았고 튜토리얼을 찾을 수도없고 작동하지도 않습니다. 어떤 점을 지적 해 주실 수 있습니까? canvas에 anythign이 표시되지 않습니다.
var result = queue.getResult ("avatar1");CreateJs EaselJS 스프라이트 시트 프레임이 작동하지 않습니다.

 var data= 
     { 
      images: [ result], 

    // The 5th value is the image index per the list defined in "images" (defaults to 0). 
    frames: [ 
     // x, y, width, height, imageIndex, regX, regY 
     //head_south":{"x":120,"h":20,"y":138,"w":15} 
     [120,138,15,20], 
     [64,0,15,20,2], 
     ], 

     animations: { 

      show: { frames: [0,1], next: true, frequency: 1 } 

    } 
    }; 

    var sp = new createjs.SpriteSheet(data); 
    createjs.Ticker.setFPS(60); 
    var sprite_anim = new createjs.BitmapAnimation(sp,"show"); 
    sprite_anim.x=100; 
    sprite_anim.y=100; 
    stage.addChild(this.sprite_anim); 
    sprite_anim.play("show"); 
    sprite_anim.gotoAndPlay('show'); 

답변

0

무대를 시세로 업데이트합니까? :

createjs.Ticker.addEventListener("tick", function(event) { 
    stage.update(event); 
}); 
+0

.이 질문에 .Closing 당신의 conern에 대한 모든 감사하지만 여전히 행운. –

+0

4 인수 [120,138,15,20, 5 인자 [64, 0,15,20,2] gloabal되지 않습니다 varaiable의 isssue 것 같아요. 그래서 변수를 글로벌 만든 다음 "js 형식 오류"와 같은 뭔가를 준 그래서 나는 4 arugment 또는 7 걸리는 알아 냈지만 5가 아니기 때문에 나는 그것을 바꿨다. 4, 지금은 잘 작동합니다. 관심을 가져 주셔서 감사합니다. –

0

4 인수 중 4 7.So 4.That가 다시 변경 [120,138,15,20, 허용 5 개 인수 [64,0,15,20,2] 인수되어 있었다 그것은 "createjs 유형의 오류 '의 오류를 생성 이유. 내가 업데이트

관련 문제