private void CreateLogo() { // create logo graphic var logo = new CCSprite("Logo.png"); logo.BlendFunc = CCBlendFunc.NonPremultiplied; logo.AnchorPoint = new CCPoint(0, 0); logo.PositionX = (base.GameView.DesignResolution.Width - logo.ContentSize.Width) / 2; logo.PositionY = GameConfig.LOGO_POSITION_Y; logo.IsAntialiased = false; foregroundLayer.AddChild(logo); // start position var startPositionX = -500.0f; var startPositionY = GameConfig.LOGO_POSITION_Y; logo.PositionX = startPositionX; logo.PositionY = startPositionY; // end position var endPositionX = (base.GameView.DesignResolution.Width - logo.ContentSize.Width) / 2; var endPositionY = startPositionY; // create and run ease move action var point = new CCPoint(endPositionX, endPositionY); var coreAction = new CCMoveTo(4.0f, point); var easeAction = new CCEaseElasticOut(coreAction); logo.RunAction(easeAction); }
private void SetupGameScene(CCScene gameScene) { gameScene.AddLayer(_layer); _layer.AddChild(_car1DrawNode); _layer.AddChild(_car2DrawNode); ReDrawScene(); _layer.Schedule(Update); }
private void CreateButtons() { buttons = new List <Button>(); Button localGame = new Button(CCColor4B.White, CCColor4B.Blue, 200, 100, 3, "Local Game", CCColor3B.Black, "Arial", 32); localGame.Position = new CCPoint(layer.ContentSize.Width / 2.0f, layer.ContentSize.Height / 2.0f); layer.AddChild(localGame); Button onlineGame = new Button(CCColor4B.White, CCColor4B.Blue, 200, 100, 3, "Online Game", CCColor3B.Black, "Arial", 32); onlineGame.Position = new CCPoint(localGame.PositionX, localGame.PositionY + 200); layer.AddChild(onlineGame); buttons.Add(localGame); buttons.Add(onlineGame); }