protected override void AddedToScene() { base.AddedToScene(); var actualSize = Scene.Window.WindowSizeInPixels; var hexMexCamera = new HexMexCamera(VisibleBoundsWorldspace.Size); Camera = hexMexCamera; var radius = actualSize.Width / 4 * 1f; StartGameButton.Radius = radius; HelpButton.Radius = radius; //OptionsButton.Radius = radius; var d = Math.Sin(Math.PI / 3) * radius * 2; var deltaX = Math.Sin(Math.PI / 6) * d; var deltaY = Math.Cos(Math.PI / 6) * d; StartGameButton.PositionX = (float)(deltaX / 2); StartGameButton.PositionY = 0 + StartGameButton.Radius; HelpButton.PositionX = (float)(StartGameButton.PositionX - deltaX); HelpButton.PositionY = (float)(StartGameButton.PositionY - deltaY); //OptionsButton.PositionX = (float)(StartGameButton.PositionX + deltaX); //OptionsButton.PositionY = (float)(StartGameButton.PositionY - deltaY); AddChild(StartGameButton); AddChild(HelpButton); //AddChild(OptionsButton); hexMexCamera.MoveToPosition(CCPoint.Zero); }
public GameScene(CCWindow window, World world) : base(window) { World = world; World.Victory += World_Victory; World.Defeat += World_Defeat; HexMexCamera = new HexMexCamera(BoundingBoxTransformedToWorld.Size); HexMexCamera.MoveToPosition(CCPoint.Zero); Camera = HexMexCamera; AddChild(GameLayer = new GameLayer(World, HexMexCamera, CCColor4B.Black)); AddChild(WinDefeatLayer = new WinDefeatLayer()); HexMexCamera.SetZoomFactor(0.5f); }