protected override void DoDraw(Graphics2D destRenderer) { int playerSequenceIndex = GetPlayerIndex(); GameImageSequence playerShip = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "Player" + (playerSequenceIndex + 1).ToString() + "Ship"); destRenderer.Render(playerShip.GetImageByRatio(m_Rotation / (2 * Math.PI)), m_Position.X, m_Position.Y); }
public override void OnDraw(Graphics2D graphics2D) { GameImageSequence menuBackground = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "MainMenuBackground"); graphics2D.Render(menuBackground.GetImageByIndex(0), 0, 0); GameImageSequence planetOnMenu = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "PlanetOnMenu"); graphics2D.Render(planetOnMenu.GetImageByRatio(planetRatio.Read()), 620, 360); GameImageSequence shipOnMenu = (GameImageSequence)DataAssetCache.Instance.GetAsset(typeof(GameImageSequence), "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); }
protected override void DoDraw(Graphics2D destRenderer) { GameImageSequence rockShip = GetImageSequence(); destRenderer.Render(rockShip.GetImageByRatio(playRatio), m_Position.x, m_Position.y, 0, scaleRatio, scaleRatio); }