public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; sharedWindow = mainWindow; var introScene = IntroLayer.CreateScene(mainWindow); sharedWindow.RunWithScene(introScene); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var application = new CCApplication(); application.ApplicationDelegate = new GameAppDelegate(); SetContentView(application.AndroidContentView); application.StartGame(); }
private static void Main(string[] args) { Locator.CurrentMutable.RegisterConstant(new ConsoleLogger(), typeof(ILogger)); var app = new CCApplication(false, new CCSize(1024f, 768f)) { ApplicationDelegate = new CocosInjectionAppDelgate() }; app.StartGame(); }
public static Texture2D GetTexture2D(Word p_Word) { if (p_Word.IsContent) { return(Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, Content.Current.ReadFile(p_Word.PictureFilePath))); } else { return(Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, Storage.Current.ReadFile(p_Word.PictureFilePath))); } }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; var bounds = mainWindow.WindowSizeInPixels; CCScene.SetDefaultDesignResolution(bounds.Width, bounds.Height, CCSceneResolutionPolicy.ShowAll); // todo: Add our GameScene initialization here }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var application = new CCApplication(); // GameAppDelegate is your class that inherits // from CCApplicationDelegate application.ApplicationDelegate = new GameAppDelegate(); SetContentView(application.AndroidContentView); application.StartGame(); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { var bounds = mainWindow.WindowSizeInPixels; CCScene.SetDefaultDesignResolution(bounds.Width, bounds.Height, CCSceneResolutionPolicy.ShowAll); application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; var gameScene = new GameScene(mainWindow); mainWindow.RunWithScene(gameScene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; var windowSize = mainWindow.WindowSizeInPixels; mainWindow.DisplayStats = true; // This will set the world bounds to be (0,0, w, h) // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved CCScene.SetDefaultDesignResolution(Constants.COCOS_WORLD_WIDTH, Constants.COCOS_WORLD_HEIGHT, CCSceneResolutionPolicy.ShowAll); // Determine whether to use the high or low def versions of our images // Make sure the default texel to content size ratio is set correctly // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd) /* * if (desiredWidth < windowSize.Width) * { * application.ContentSearchPaths.Add("hd"); * CCSprite.DefaultTexelToContentSizeRatio = 2.0f; * } * else * { * application.ContentSearchPaths.Add("ld"); * CCSprite.DefaultTexelToContentSizeRatio = 1.0f; * } */ application.ContentSearchPaths = new List <string>() { "sounds", "hd/graphics", "hd/fonts" }; //CCSprite.DefaultTexelToContentSizeRatio = 1.0f; //CCSprite.DefaultTexelToContentSizeRatio = 0.125f; //CCSprite.DefaultTexelToContentSizeRatio = 0.0625f; var scene = new CCScene(mainWindow); //var playLayer = new PlayLayer(); //var wreckLayer = new WreckageLayer(); //wreckLayer.DEBUG = true; var hangarLayer = new HangarLayer(); FinishedLoading = true; scene.AddChild(hangarLayer.GUILayer); scene.AddChild(hangarLayer, zOrder: int.MinValue); //scene.AddChild(playLayer.GUILayer); //scene.AddChild(playLayer, zOrder:int.MinValue); //scene.AddChild(wreckLayer.GUILayer); //scene.AddChild(wreckLayer, zOrder:int.MinValue); mainWindow.RunWithScene(scene); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var application = new CCApplication(); application.ApplicationDelegate = new GoneBananasApplicationDelegate(); SetContentView(application.AndroidContentView); application.StartGame(); // Set our view from the "main" layout resource // SetContentView (Resource.Layout.Main); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); CoinTimeGame.ContentLoading.XmlDeserializer.Self.Activity = this; var application = new CCApplication(); application.ApplicationDelegate = new GameAppDelegate(); SetContentView(application.AndroidContentView); application.StartGame(); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { //application.SupportedOrientations = CCDisplayOrientation.LandscapeRight | CCDisplayOrientation.LandscapeLeft; //application.AllowUserResizing = true; //application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; sharedWindow = mainWindow; mainWindow.SetDesignResolutionSize(960, 640, CCSceneResolutionPolicy.ShowAll); #if WINDOWS || WINDOWSGL || WINDOWSDX //application.PreferredBackBufferWidth = 1024; //application.PreferredBackBufferHeight = 768; #elif MACOS //application.PreferredBackBufferWidth = 960; //application.PreferredBackBufferHeight = 640; #endif #if WINDOWS_PHONE8 application.HandleMediaStateAutomatically = false; // Bug in MonoGame - https://github.com/Cocos2DXNA/cocos2d-xna/issues/325 #endif CCSpriteFontCache.FontScale = 0.6f; CCSpriteFontCache.RegisterFont("arial", 12, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 50, 64); CCSpriteFontCache.RegisterFont("MarkerFelt", 16, 18, 22, 32); CCSpriteFontCache.RegisterFont("MarkerFelt-Thin", 12, 18); CCSpriteFontCache.RegisterFont("Paint Boy", 26); CCSpriteFontCache.RegisterFont("Schwarzwald Regular", 26); CCSpriteFontCache.RegisterFont("Scissor Cuts", 26); CCSpriteFontCache.RegisterFont("A Damn Mess", 26); CCSpriteFontCache.RegisterFont("Abberancy", 26); CCSpriteFontCache.RegisterFont("Abduction", 26); //sharedDirector = new CCDirector(); //director.DisplayStats = true; //director.AnimationInterval = 1.0 / 60; // if (sharedWindow.WindowSizeInPixels.Height > 320) // { // application.ContentSearchPaths.Insert(0,"HD"); // } //sharedWindow.AddSceneDirector(sharedDirector); CCScene scene = new CCScene(sharedWindow); CCLayer layer = new TestController(); scene.AddChild(layer); sharedWindow.RunWithScene(scene); }
public void Open(string pFileName, uint uId) { if (pFileName != null) { if (pFileName.Length == 0) { return; } this.Close(); this.m_effect = CCApplication.sharedApplication().content.Load <SoundEffect>(pFileName); this.m_nSoundID = uId; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ContentLoading.XmlDeserializer.Self.Activity = this; var application = new CCApplication(); application.ApplicationDelegate = new GameAppDelegate(); //https://forums.xamarin.com/discussion/55345/cocossharp-v1-7-0-0-pre1-embeddable-game-view-and-xamarin-forms-support SetContentView(application.AndroidContentView); application.StartGame(); application.AndroidContentView.RequestFocus(); application.AndroidContentView.KeyPress += HandleKeyPress; }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override void FinishedLaunching(UIApplication app) { CCApplication application = new CCApplication(); application.ApplicationDelegate = new GameAppDelegate(); #if !DEBUG Xamarin.Insights.Initialize("24e57f0b30120942dd4c385da58011842fe77c59"); Xamarin.Insights.ForceDataTransmission = true; #endif application.StartGame(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); #if OUYA Ouya.Console.Api.OuyaFacade.Instance.Init(this, "f3366755-190b-4b95-af21-ca4a01a99478"); // Our UUID dev ID #endif CCApplication application = new CCApplication(); application.ApplicationDelegate = new AppDelegate(); this.SetContentView(application.AndroidContentView); application.StartGame(); }
public void Open(string pFileName, uint uId) { if (null == pFileName || pFileName.Length == 0) { return; } Close(); m_music = CCApplication.sharedApplication().content.Load <Song>(pFileName); m_nSoundID = uId; }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { SharedApplication = application; SharedWindow = mainWindow; mainWindow.DisplayStats = true; application.ContentRootDirectory = "Content"; application.PreferMultiSampling = true; var windowSize = mainWindow.WindowSizeInPixels; var desiredWidth = 1024.0f; var desiredHeight = 768.0f; CocosSharpEngine engine = new CocosSharpEngine(application.GraphicsDevice, (int)desiredWidth, (int)desiredHeight); // This will set the world bounds to be (0,0, w, h) // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll); mainWindow.AllowUserResizing = true; //mainWindow.AllowUserResizing = false; //// Determine whether to use the high or low def versions of our images //// Make sure the default texel to content size ratio is set correctly //// Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd) //if (desiredWidth < windowSize.Width) //{ // application.ContentSearchPaths.Add("hd"); // CCSprite.DefaultTexelToContentSizeRatio = 2.0f; //} //else //{ // application.ContentSearchPaths.Add("ld"); // CCSprite.DefaultTexelToContentSizeRatio = 1.0f; //} // Poll incomming messages SharedApplication.Scheduler.Schedule(GameClient.Instance, 0, false); application.AnimationInterval = 1 / 120.0f; ResourceDictionary.DefaultDictionary = Light.GetThemeDictionary(); SpriteFont font = CCContentManager.SharedContentManager.Load <SpriteFont>("fonts/Segoe_UI_10_Regular"); FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font); FontManager.Instance.LoadFonts(CCContentManager.SharedContentManager, "fonts"); SuperManager.Instance.InitializeManagers(typeof(Manager.ActorManager).Namespace); SceneLoader.Instance.LoadLoginScene(); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; var windowSize = mainWindow.WindowSizeInPixels; var desiredWidth = 1024.0f; var desiredHeight = 768.0f; var screen = new ScreenDetails { Height = desiredHeight, Width = desiredWidth }; GameData gameData = new GameData { Screen = screen, Input = new EnvironmentInputs(), Player = new PlayerPosition(), }; // This will set the world bounds to be (0,0, w, h) // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll); // Determine whether to use the high or low def versions of our images // Make sure the default texel to content size ratio is set correctly // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd) if (desiredWidth < windowSize.Width) { application.ContentSearchPaths.Add("hd"); CCSprite.DefaultTexelToContentSizeRatio = 2.0f; } else { application.ContentSearchPaths.Add("ld"); CCSprite.DefaultTexelToContentSizeRatio = 1.0f; } var scene = new CCScene(mainWindow); var introLayer = new TerrainLayer(gameData); var playerLayer = new PlayerLayer(gameData); scene.AddChild(introLayer); scene.AddChild(playerLayer); mainWindow.RunWithScene(scene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; mainWindow.SupportedDisplayOrientations.IsPortrait = CCDisplayOrientation.Portrait; application.ContentSearchPaths.Add("hd"); CCSimpleAudioEngine.SharedEngine.PreloadEffect("Sounds/tap"); CCScene scene = GameStartLayer.GameStartLayerScene(mainWindow); mainWindow.RunWithScene(scene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { sharedWindow = mainWindow; preferredWidth = application.MainWindow.WindowSizeInPixels.Width; preferredHeight = application.MainWindow.WindowSizeInPixels.Height; DefaultResolution = new CCSize(preferredWidth, preferredHeight); application.ContentRootDirectory = "Content"; application.ContentSearchPaths.Add("SD"); CCScene scene = ChipmunkDemoLayer.ActualScene; mainWindow.RunWithScene(scene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; application.PreferMultiSampling = false; CCSize winSize = mainWindow.WindowSizeInPixels; float desiredWidth = 640.0f; float desiredHeight = 960.0f; CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ExactFit); CCScene scene = MenuLayer.GameStartLayerScene(mainWindow); mainWindow.RunWithScene(scene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; application.ContentSearchPaths.Add("animations"); application.ContentSearchPaths.Add("fonts"); application.ContentSearchPaths.Add("sounds"); CCSize windowSize = mainWindow.WindowSizeInPixels; float desiredWidth = 1024.0f; float desiredHeight = 768.0f; // This will set the world bounds to be (0,0, w, h) // Use CCSceneResolutionPolicy.Custom as we're manually setting our viewports CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.Custom); // Determine whether to use the high or low def versions of our images // Make sure the default texel to content size ratio is set correctly // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd) if (desiredWidth < windowSize.Width) { application.ContentSearchPaths.Add("images/hd"); CCSprite.DefaultTexelToContentSizeRatio = 2.0f; } else { application.ContentSearchPaths.Add("images/ld"); CCSprite.DefaultTexelToContentSizeRatio = 1.0f; } var topViewport = new CCViewport(new CCRect(0.0f, 0.2f, .5f, 0.6f)); var bottomViewport = new CCViewport(new CCRect(0.5f, 0.0f, .5f, 1.0f)); // Each viewport needs its own director var sceneDirector1 = new CCDirector(); var sceneDirector2 = new CCDirector(); var scene1 = new CCScene(mainWindow, topViewport, sceneDirector1); var scene2 = new CCScene(mainWindow, bottomViewport, sceneDirector2); var layer1 = new GameLayer(); var layer2 = new GameLayer(); scene1.AddChild(layer1); scene2.AddChild(layer2); sceneDirector1.RunWithScene(scene1); sceneDirector2.RunWithScene(scene2); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; var windowSize = mainWindow.WindowSizeInPixels; #if __ANDROID__ var desiredWidth = 480f; var desiredHeight = 800f; #elif WINDOWS var desiredWidth = 480f; var desiredHeight = 800f; #elif __IOS__ var desiredWidth = 640.0f; var desiredHeight = 960.0f; #endif // This will set the world bounds to be (0,0, w, h) // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll); // Determine whether to use the high or low def versions of our images // Make sure the default texel to content size ratio is set correctly // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd) #if __IOS__ CCSprite.DefaultTexelToContentSizeRatio = 0.8f; #elif __ANDROID__ CCSprite.DefaultTexelToContentSizeRatio = 0.9f; #else CCSprite.DefaultTexelToContentSizeRatio = 1.0f; #endif if (desiredWidth < windowSize.Width) { application.ContentSearchPaths.Add("hd"); //CCSprite.DefaultTexelToContentSizeRatio = 2.0f; } else { application.ContentSearchPaths.Add("ld"); //CCSprite.DefaultTexelToContentSizeRatio = 1.0f; } var scene = new CCScene(mainWindow); var introLayer = new IntroLayer(); scene.AddChild(introLayer); mainWindow.RunWithScene(scene); }
/// <summary> /// Implement CCDirector and CCScene init code here. /// </summary> /// <returns> /// true Initialize success, app continue. /// false Initialize failed, app terminate. /// </returns> public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { preferredWidth = application.MainWindow.WindowSizeInPixels.Width; preferredHeight = application.MainWindow.WindowSizeInPixels.Height; application.ContentRootDirectory = "Content"; application.ContentSearchPaths.Add("SD"); CCScene scene = new CCScene(mainWindow); CCLayer layer = new IntroLayer(new CCSize(preferredWidth, preferredHeight)); scene.AddChild(layer); mainWindow.RunWithScene(scene); }
public static async Task <CCApplication> Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req, ILogger log) { log.LogInformation("C# HTTP trigger function processed a request."); string content = await req.ReadAsStringAsync(); CCApplication ccApplication = JsonConvert.DeserializeObject <CCApplication>(content); log.LogInformation($"Received Credit Card Application from : {ccApplication.Name }"); //await applicationQueue.AddAsync(ccApplication); return(ccApplication); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); CCLog.Logger = (e, a) => { }; System.Diagnostics.Debug.WriteLine(""); #if DEBUG Tests.RunTests(); #endif string buildingXml; string colorXml; string languageXml; using (var colorsStream = Assets.Open("colors.xml")) { using (var sr = new StreamReader(colorsStream)) { colorXml = sr.ReadToEnd(); } } using (var buildingStream = Assets.Open("buildings.xml")) { using (var sr = new StreamReader(buildingStream)) { buildingXml = sr.ReadToEnd(); } } using (var languageStream = Assets.Open("languages.xml")) { using (var sr = new StreamReader(languageStream)) { languageXml = sr.ReadToEnd(); } } var buildingDescriptionDatabase = BuildingDescriptionDatabase.CreateFromXml(buildingXml); var colorCollectionFile = ColorCollectionFile.CreateFromXml(colorXml); var languageSettings = LoadLanguagesFromXml(languageXml); CCApplication application = new CCApplication { ApplicationDelegate = new AppDelegate(new AndroidDataLoader(), this, buildingDescriptionDatabase, colorCollectionFile, languageSettings) }; SetContentView(application.AndroidContentView); application.StartGame(); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; sharedWindow = mainWindow; DefaultResolution = new CCSize( application.MainWindow.WindowSizeInPixels.Width, application.MainWindow.WindowSizeInPixels.Height); CCScene scene = new CCScene(sharedWindow); CCLayer layer = new IntroLayer(DefaultResolution); scene.AddChild(layer); sharedWindow.RunWithScene(scene); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; CCSize winSize = mainWindow.WindowSizeInPixels; mainWindow.SetDesignResolutionSize(winSize.Width, winSize.Height, CCSceneResolutionPolicy.ExactFit); InitializeCards(); //Game Initializer GameScene scene = GameStartLayer.GameStartLayerScene(mainWindow); mainWindow.RunWithScene(scene); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); #if !DEBUG Xamarin.Insights.Initialize("24e57f0b30120942dd4c385da58011842fe77c59"); Xamarin.Insights.ForceDataTransmission = true; #endif var application = new CCApplication(); application.ApplicationDelegate = new GameAppDelegate(); GameAppDelegate.CurrentActivity = this; SetContentView(application.AndroidContentView); application.StartGame(); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { application.ContentRootDirectory = "Content"; sharedWindow = mainWindow; DefaultResolution = new CCSize( application.MainWindow.WindowSizeInPixels.Width, application.MainWindow.WindowSizeInPixels.Height); //mainWindow.SetDesignResolutionSize(960, 640, CCSceneResolutionPolicy.ShowAll); //application.HandleMediaStateAutomatically = false; //mainWindow.DisplayStats = true; CCScene scene = GoblinLayer.Scene; sharedWindow.RunWithScene(scene); }