This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?showtopic=549&view=getnewpost as retrieved on 10 Aug 2007 03:28:02 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:Qz5i8bOxfu8J:www.flashsandy.org/forum/index.php%3Fshowtopic%3D549%26view%3Dgetnewpost+site:www.flashsandy.org+showtopic&hl=en&ct=clnk&cd=23


Google is neither affiliated with the authors of this page nor responsible for its content.
These search terms have been highlighted: showtopic 

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Sprite3DRotator, a utils class to rotate Sprite3D
damo
post Jun 6 2007, 03:50 PM
Post #1


Advanced Member
***

Group: Members
Posts: 44
Joined: 20-June 06
Member No.: 26



Hi all,
I've make a usefull class to do an animate rotation of a Sprite3D Offset.
See this previous post to understand how to calculate the correct offset : http://www.flashsandy.org/forum/index.php?showtopic=523

With my new class Sprite3DRotator, i can do an animate rotation like this :
CODE
Sprite3DRotator.getInstance().rotate(mySprite3D,angleDegree,10);


So now, have a look to my (little) class :

CODE
/**
* Utilitaire pour sprite
* @author David Mouton
* @version 1
*/
import sandy.core.Sprite3D;
import mx.transitions.Tween;
import mx.transitions.easing.*;

class com.expantion.utils.sprite.Sprite3DRotator {

    private var __sprite3D:Sprite3D;
    private static var __monInstance:Sprite3DRotator;
    
    private function Sprite3DRotator(){
        
    }
    
    public function get spriteOffset():Number{
        return __sprite3D.getOffset();
    }
    
    public function set spriteOffset(val:Number):Void{
        __sprite3D.setOffset(val);
    }
    
    
    /**
    * Effectue une rotation anime du Sprite3D
    * @param    s
    * @param    endOffset
    * @param    time
    */
    public function rotate(s:Sprite3D,endOffset:Number,time:Number, easeFunction:Function):Void{
        __sprite3D = s;
        var debOffset:Number = s.getOffset();
        if(easeFunction == undefined){
            easeFunction = Regular.easeInOut;
        }
        var tw:Tween = new Tween(__monInstance,"spriteOffset",easeFunction,debOffset,endOffset,time,false);
    }
    
    /**
    * Acces aux methodes et aux propriétés du singleton
    * @return
    */
    public static function getInstance():Sprite3DRotator{
        if (__monInstance == undefined) {
            __monInstance = new Sprite3DRotator();
        }
        return(__monInstance);        
    }
    
}


have fun (IMG:style_emoticons/default/wink.gif)


Attached File(s)
Attached File  Sprite3DRotator.as ( 1.21k ) Number of downloads: 20
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Petit
post Jun 6 2007, 03:57 PM
Post #2


Advanced Member
***

Group: Moderator
Posts: 587
Joined: 21-June 06
From: Borgholm, Sweden
Member No.: 38



QUOTE(damo @ Jun 6 2007, 03:50 PM) *

Hi all,
I've make a usefull class to do an animate rotation of a Sprite3D Offset.
See this previous post to understand how to calculate the correct offset.
have fun (IMG:style_emoticons/default/wink.gif)

Thanks damo for getting back with this nice piece of code.
Much appreciated! (IMG:style_emoticons/default/rolleyes.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
damo
post Jun 7 2007, 08:31 AM
Post #3


Advanced Member
***

Group: Members
Posts: 44
Joined: 20-June 06
Member No.: 26



Hey petit,
It seems i'm in a good day. So i wrote this little tuto about Sprite3D and Orientation.
It's in french and on my blog here :
http://www.tamina-online.com/damo/index.ph...ibution-a-sandy

(IMG:style_emoticons/default/biggrin.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 10th August 2007 - 03:06 AM
phpMyVisites