Example #1
0
        public SpriteBase( SpriteBase o )
        {
            this.m_vecPos = o.Position;
            this.m_vecOrigin = o.m_vecOrigin;
            this.m_playbackOptions = o.AnimationOptions;

            this.m_texBase = o.m_texBase;

            this.m_fScale = o.m_fScale;
            this.m_fRotation = o.m_fRotation;

            this.m_iCurrFrame = o.m_iCurrFrame;
            this.m_iMaxFrames = o.m_iMaxFrames;
            this.m_iFrameWidth = o.m_iFrameWidth;

            this.m_fFrameTime = o.m_fFrameTime;
            this.m_fTimeAccumulator = o.m_fTimeAccumulator;

            this.m_frameRect = o.m_frameRect;

            this.m_AABBs = o.m_AABBs;

            this.basicEffect = o.basicEffect;
            this.vertices = o.vertices;

            this.m_bDisplayAABBs = o.m_bDisplayAABBs;
        }
Example #2
0
 // Sets PlaybackOptions for currently selected animation
 public void SetPlaybackOptions( PlaybackOptions playbackOptions )
 {
     if (m_SpriteAnims.ContainsKey(m_strCurrAnim))
     {
         m_SpriteAnims[m_strCurrAnim].AnimationOptions = playbackOptions;
     }
 }
Example #3
0
        public SpriteBase(Vector2 pos, int frameWidth, float frameRate, GraphicsDevice pDevice )
        {
            m_playbackOptions = PlaybackOptions.None;

            m_vecPos = pos;
            m_fScale = 1.0f;
            m_fRotation = 0.0f;

            m_iCurrFrame = 0;
            m_iFrameWidth = frameWidth;

            m_fFrameTime = (1.0f / frameRate);

            m_AABBs = new List<Rectangle>();

            m_bDisplayAABBs = false;

            // Set rendering of debug BBs
            vertices = new VertexPositionColor[4];
            basicEffect = new BasicEffect(pDevice);
            basicEffect.VertexColorEnabled = true;
            basicEffect.Projection = Matrix.CreateOrthographicOffCenter(0, pDevice.Viewport.Width, pDevice.Viewport.Height, 0, 0, 1);
        }