Exemplo n.º 1
0
        public override void OnDraw(RendererBase rendererToDrawWith)
        {
            ImageSequence menuBackground = (ImageSequence)DataAssetCache.Instance.GetAsset(typeof(ImageSequence), "MainMenuBackground");

            rendererToDrawWith.Render(menuBackground.GetImageByIndex(0), 0, 0);

            ImageSequence planetOnMenu = (ImageSequence)DataAssetCache.Instance.GetAsset(typeof(ImageSequence), "PlanetOnMenu");

            rendererToDrawWith.Render(planetOnMenu.GetImageByRatio(planetRatio.Read()), 620, 360);

            base.OnDraw(rendererToDrawWith);
        }
Exemplo n.º 2
0
        public override void OnDraw(Graphics2D graphics2D)
        {
            ImageSequence menuBackground = (ImageSequence)DataAssetCache.Instance.GetAsset(typeof(ImageSequence), "MainMenuBackground");

            graphics2D.Render(menuBackground.GetImageByIndex(0), 0, 0);

            ImageSequence planetOnMenu = (ImageSequence)DataAssetCache.Instance.GetAsset(typeof(ImageSequence), "PlanetOnMenu");

            graphics2D.Render(planetOnMenu.GetImageByRatio(planetRatio.Read()), 620, 360);

            ImageSequence shipOnMenu = (ImageSequence)DataAssetCache.Instance.GetAsset(typeof(ImageSequence), "Player1Ship");

            int    numFrames          = shipOnMenu.NumFrames;
            double animationRatio0to1 = shipRatio.Read();
            double curFrameDouble     = (numFrames - 1) * animationRatio0to1;
            int    curFrameInt        = shipOnMenu.GetFrameIndexByRatio(animationRatio0to1);
            double curFrameRemainder  = curFrameDouble - curFrameInt;
            double anglePerFrame      = MathHelper.Tau / numFrames;
            double angleForThisFrame  = curFrameRemainder * anglePerFrame;

            graphics2D.Render(shipOnMenu.GetImageByIndex(curFrameInt), 177, 156, angleForThisFrame, 1, 1);

            base.OnDraw(graphics2D);
        }
Exemplo n.º 3
0
        protected override void DoDraw(Graphics2D destRenderer)
        {
            ImageSequence rockShip = GetImageSequence();

            destRenderer.Render(rockShip.GetImageByRatio(playRatio), m_Position.X, m_Position.Y, 0, scaleRatio, scaleRatio);
        }