2012-05-10 7 views
0

나는 로터가있는 두 바퀴 (스프라이트)를 가지고 있는데, 회전하면 흰 부분이 나타난다. 로더가 스프라이트의 중앙에 위치하며 흰색 부분을 사라지게하려고합니다.흰색 부분이 사라지게하려면 어떻게해야합니까?

enter image description here

어떤 아이디어가?

모든 포인터는 진짜로 여전히 3.

//create the first wheel 
    backgroundURL = new URLRequest(); 
    backgroundLoader = new Loader(); 
    myWheelSprite = new Sprite(); 
    backgroundURL.url = "images/wheelimage.jpg"; 
    backgroundLoader.load(backgroundURL); 

    //Use contentLoaderInfo.addEventListener to find out the image width and height. 
    backgroundLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,backgroundLoaderimageFinishedLoading); 
    myWheelSprite.x = 60; 
    myWheelSprite.y = 60; 
    myWheelSprite.addEventListener(MouseEvent.CLICK, myMouseClickFunction); 
    trace("myWheelSprite X = "+myWheelSprite.x); 

    //create the second wheel 
    backgroundURL2 = new URLRequest(); 
    backgroundLoader2 = new Loader(); 
    myWheelSprite2 = new Sprite(); 
    backgroundURL2.url = "images/wheelimage.jpg"; 
    backgroundLoader2.load(backgroundURL); 

    //Use contentLoaderInfo.addEventListener to find out the image width and height. backgroundLoader2.contentLoaderInfo.addEventListener(Event.COMPLETE,backgroundLoader2imageFinishedLoading); 
    myWheelSprite2.x =480; 
    myWheelSprite2.y = 480; 
    trace("myWheelSprite2 X = "+myWheelSprite2.x); 

//My code to rotate the image. 

function myMouseClickFunction(event:MouseEvent) { 
    var myTimeline:TimelineMax = new TimelineMax({repeat:10}); 
    myTimeline.append(TweenLite.to(myWheelSprite, 10, {rotation:360, ease:Linear.easeNone})); 
    }  
+0

흰색 부분 ...? 스크린 샷이 훌륭합니다. – Marty

+0

정말로 가장 짜증나는 이미지 공유 사이트를 찾았습니다. 대신 이미지를 stackoverflow에 업로드하십시오. – grapefrukt

답변

4

은 당신이보고있는 것은 바로 하나를 중복 가장 왼쪽 이미지의 흰색 배경입니다 액션 상당히 새로운 감사하겠습니다.

여기서 가장 좋은 해결책은 투명성을 지원하는 이미지 형식을 사용하는 것입니다. PNG가 가장 좋습니다.

흰색 부분을 제거하고 이미지를 다시 저장하려면 포토샵과 같은 것을 사용하십시오. 플래시는 투명도를 존중하며 모든 것이 잘 보입니다.

0

".jpg"이 (가) 문제입니다. JPG 형식은 투명도를 지원하지 않습니다. 그러나 PNG는 않습니다.

관련 문제