public bool Handle(IEvent evt) { PlayerLostEvent playerLostEvent = evt as PlayerLostEvent; if (playerLostEvent != null) { WaitProcess processChain = new WaitProcess(Constants.Animations.GAME_OVER_WAIT); string gameOverContent = playerLostEvent.WinPlayer.Name + Constants.Pong.GAME_OVER_CONTENT_SUFFIX; processChain.SetNext(new GameOverTextAnimation(_engine, FontEntity.Create(_engine, Vector2.Zero, Content.Load <BitmapFont>(Constants.Resources.FONT_PONG_INTRO), gameOverContent), _mainCamera, GameManager.GraphicsDevice)) .SetNext(new WaitProcess(Constants.Animations.GAME_OVER_POST_WAIT)) .SetNext(new DelegateCommand(() => { GameManager.ChangeState(new LobbyGameState(GameManager, _player1.InputMethod, (_player2 is AIPlayer) ? null : _player2.InputMethod)); })); _processManager.Attach(processChain); return(false); } return(false); }
void BeginIntroSequence() { WaitProcess wait1 = new WaitProcess(Constants.Animations.INTRO_WAIT_DURATION); ReadyIntroTextAnimation readyIntroAnimation = new ReadyIntroTextAnimation(_engine, FontEntity.Create(_engine, Vector2.Zero, Content.Load <BitmapFont>(Constants.Resources.FONT_PONG_INTRO), Constants.Pong.INTRO_READY_CONTENT), _mainCamera, GameManager.GraphicsDevice); wait1.SetNext(readyIntroAnimation); GoIntroTextAnimation goIntroAnimation = new GoIntroTextAnimation(_engine, FontEntity.Create(_engine, Vector2.Zero, Content.Load <BitmapFont>(Constants.Resources.FONT_PONG_INTRO), Constants.Pong.INTRO_GO_CONTENT), _mainCamera, GameManager.GraphicsDevice); readyIntroAnimation.SetNext(goIntroAnimation); goIntroAnimation.SetNext(new DelegateCommand(() => { EventManager.Instance.TriggerEvent(new StartEvent()); })); _processManager.Attach(wait1); }
static void Main(string[] args) { //Open the presentation Presentation pres = new Presentation("source.ppt"); //Add Verdana font FontEntity font = pres.Fonts[0]; FontEntity verdanaFont = new FontEntity(pres, font); verdanaFont.FontName = "Verdana"; int verdanaFontIndex = pres.Fonts.Add(verdanaFont); //Access the first slide Slide slide = pres.GetSlideByPosition(1); //Access the third shape Shape shp = slide.Shapes[2]; //Change its text's font to Verdana and height to 32 TextFrame tf = shp.TextFrame; Paragraph para = tf.Paragraphs[0]; Portion port = para.Portions[0]; port.FontIndex = verdanaFontIndex; port.FontHeight = 32; //Bolden it port.FontBold = true; //Italicize it port.FontItalic = true; //Change text color port.FontColor = Color.FromArgb(0x33, 0x33, 0xCC); //Change shape background color shp.FillFormat.Type = FillType.Solid; shp.FillFormat.ForeColor = Color.FromArgb(0xCC, 0xCC, 0xFF); //Write the output to disk pres.Write("outAspose.ppt"); }
static void Main(string[] args) { //Open the presentation Presentation pres = new Presentation("source.ppt"); //Add Verdana font FontEntity font = pres.Fonts[0]; FontEntity verdanaFont = new FontEntity(pres, font); verdanaFont.FontName = "Verdana"; int verdanaFontIndex = pres.Fonts.Add(verdanaFont); //Access the first slide Slide slide = pres.GetSlideByPosition(1); //Access the third shape Shape shp = slide.Shapes[2]; //Change its text's font to Verdana and height to 32 TextFrame tf = shp.TextFrame; Paragraph para = tf.Paragraphs[0]; Portion port = para.Portions[0]; port.FontIndex = verdanaFontIndex; port.FontHeight = 32; //Bolden it port.FontBold = true; //Italicize it port.FontItalic = true; //Change text color port.FontColor = Color.FromArgb(0x33, 0x33, 0xCC); //Change shape background color shp.FillFormat.Type = FillType.Solid; shp.FillFormat.ForeColor = Color.FromArgb(0xCC, 0xCC, 0xFF); //Write the output to disk pres.Write("outAspose.ppt"); }