/// <summary> /// Loads all content /// </summary> /// <param name="manager"></param> public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager manager) { base.LoadContent(manager); this.ScreenManager.SpriteFonts.LoadFont("PopFont", "Fonts/ScorePop"); this.Size = this.ScreenManager.SpriteFonts["PopFont"].MeasureString(_rowText); }
public void Initialise(Microsoft.Xna.Framework.Content.ContentManager Content, Game1 game, GraphicsDeviceManager graphics) { this.Game = game; this.Graphics = graphics; MenuItemText = Content.Load <SpriteFont>("Menu_Text"); TitleText = Content.Load <SpriteFont>("TitleText"); TextBoxNotSelected = 0.4f; TextBoxSelected = 0.5f; OptionSelected = 0; MenuItems = 1; BackGround = Content.Load <Texture2D>("Light_Blue_Opaque"); TextBox = Content.Load <Texture2D>("TextBox"); BackGroundSource = new Rectangle(0, 0, BackGround.Width, BackGround.Height); BackGroundDest = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); SelectionRate = 200f; selectionElapsedTime = 0f; Title = new StringBuilder(); Title.Append("Battle Ships"); Option1 = new StringBuilder(); Option1.Append("Return to Game"); Option2 = new StringBuilder(); Option2.Append("Exit"); WaterBackground = new Texture2D[22]; for (int num = 1; num < WaterBackground.Length; num++) { WaterBackground[num] = Content.Load <Texture2D>("ocean" + num.ToString()); } curBackground = 1; BackGroundFrameRate = 100f; BackGroundElapsedTime = 0f; }
/// <summary> /// Loads all of the entity textures. /// </summary> /// <param name="Content"></param> public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content) { AddEntityTexture("Cat Girl", Content.Load <Texture2D>("Character Cat Girl")); AddEntityTexture("Tree", Content.Load <Texture2D>("Tree Tall")); AddEntityTexture("Princess", Content.Load <Texture2D>("Character Princess Girl")); AddEntityTexture("Bug", Content.Load <Texture2D>("Enemy Bug")); }
public override void Load(BinaryReader BR) { SpawnUnitName = BR.ReadString(); int SpawnCharacterCount = BR.ReadInt32(); _SpawnCharacter = new string[SpawnCharacterCount]; for (int C = 0; C < SpawnCharacterCount; C++) { _SpawnCharacter[C] = BR.ReadString(); } _DeleteAfterMission = BR.ReadBoolean(); Microsoft.Xna.Framework.Content.ContentManager Content = GameScreen.ContentFallback; if (Content != null && !string.IsNullOrEmpty(_SpawnUnitName)) { string[] UnitInfo = _SpawnUnitName.Split(new[] { "\\" }, StringSplitOptions.None); _SpawnUnit = Unit.FromType(UnitInfo[0], _SpawnUnitName.Remove(0, UnitInfo[0].Length + 1), Content, Map.DicUnitType, Map.DicRequirement, Map.DicEffect, Map.DicAutomaticSkillTarget); _SpawnUnit.ArrayCharacterActive = new Character[_SpawnCharacter.Length]; for (int C = 0; C < _SpawnCharacter.Length; C++) { _SpawnUnit.ArrayCharacterActive[C] = new Character(_SpawnCharacter[C], Content, Map.DicRequirement, Map.DicEffect, Map.DicAutomaticSkillTarget, Map.DicManualSkillTarget); } } }
public void LoadTextures(Microsoft.Xna.Framework.Content.ContentManager Content) { //Content.Load<Texture2D>("Name") Background = Content.Load <Texture2D>("GameResources/BackGrounds/Background"); shipTex = Content.Load <Texture2D>("GameResources/Ships/ship"); bulletTexSheet = Content.Load <Texture2D>("GameResources/Bullets/BulletSheet"); }
public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content) { gamePad = new GamePadMapper(PlayerIndex.One); GameSprite background = new GameSprite(Content.Load <Texture2D>("Background\\Error"), Vector2.Zero, Color.White); background.Scale = Global.Scale; //errorDropInFont = new DropInFont(Content.Load<SpriteFont>("Fonts\\JingJingTitle"), new Vector2(400, 50), new Vector2(400, 50), dropSpeed, "Error", Color.CornflowerBlue); //errorDropInFont.IsVisible = true; //errorDropInFont.SetCenterAsOrigin(); //errorDropInFont.EnableShadow = false; //errorDropInFont.TintColor = Color.Black; //errorDropInFont.ShadowPosition = new Vector2(errorDropInFont.Position.X - 4, errorDropInFont.Position.Y + 4); //errorDropInFont.ShadowColor = Color.Gray; //errorInfoFadingFont = new FadingFont(Content.Load<SpriteFont>("Fonts\\SpriteFont1"), new Vector2(_viewPort.Width / 2, _viewPort.Height / 2 - 50), 0.1f, 1.0f, 0.01f, 1.0f, errorInfo, Color.White, false); //errorInfoFadingFont.SetCenterAsOrigin(); //errorInfoFadingFont.EnableShadow = false; backButton = new Button(Content.Load <Texture2D>("Buttons//Back"), new Vector2(0, 0), Color.White, new Rectangle(0, 149, 159, 169), new Rectangle(0, 0, 159, 149)); backButton.Origin = new Vector2(backButton.Texture.Width / 2, 169); backButton.Position = new Vector2(177, 907 + backButton.SourceRectangle.Value.Height / 2); //_sprites.Add(errorDropInFont); //_sprites.Add(errorInfoFadingFont); _sprites.Add(background); _sprites.Add(backButton); if (!Global.UsingKeyboard) { backButton.IsPressed = true; } }
public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager Content) { base.Initialize(Content); CreateFramesFromXML("ui/ui_frames"); CurrentFrame = "star"; ResetDimensions(); UniformScale = ScaleFactor; Star s; float ypos = 0.35f * BaseGame.Get.BackBufferHeight; switch (maxStars) { case 1: s = new Star(); s.TargetPos = new Vector2(0, ypos); stars.Add(s); break; case 2: s = new Star(); s.TargetPos = new Vector2(0.1f * BaseGame.Get.BackBufferWidth, ypos); stars.Add(s); s = new Star(); s.TargetPos = new Vector2(-0.1f * BaseGame.Get.BackBufferWidth, ypos); stars.Add(s); break; case 3: s = new Star(); s.TargetPos = new Vector2(0.1f * BaseGame.Get.BackBufferWidth, ypos); stars.Add(s); s = new Star(); s.TargetPos = new Vector2(-0.1f * BaseGame.Get.BackBufferWidth, ypos); stars.Add(s); s = new Star(); s.TargetPos = new Vector2(0, ypos); stars.Add(s); break; } Colour = Color.Gold; for (int i = 0; i < stars.Count; i++) { stars[i].PosX = stars[i].TargetPos.X; } Dictionary <float, float> dic = new Dictionary <float, float>(); dic.Add(-0.1f * BaseGame.Get.BackBufferWidth, BaseGame.Get.BackBufferHeight); dic.Add(0.0f * BaseGame.Get.BackBufferWidth, BaseGame.Get.BackBufferHeight * 2); dic.Add(0.1f * BaseGame.Get.BackBufferWidth, BaseGame.Get.BackBufferHeight * 3); for (int i = 0; i < stars.Count; i++) { stars[i].PosY = dic[stars[i].PosX]; } }
private SceneManager() { // Initialise Entity List mEntities = EntityManager.getInstance.Entities; mSceneGraph = new List <IEntity>(); Content = Global.Content; }
/// <summary> /// the LevelReader takes a file path string as a parameter. /// It then reads the xml file found and sets the instance variables to the value of certain information in the file. /// </summary> /// <param name="filePath"></param> public LevelReader(string filePath, Microsoft.Xna.Framework.Content.ContentManager content) { reader = XDocument.Load(filePath); Content = content; LoadFile(); }
public static Unit FromFullName(string Name, Microsoft.Xna.Framework.Content.ContentManager Content, Dictionary <string, Unit> DicUnitType, Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect, Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget) { string[] UnitInfo = Name.Split(new[] { "/" }, StringSplitOptions.None); return(FromType(UnitInfo[0], Name.Remove(0, UnitInfo[0].Length + 1), Content, DicUnitType, DicRequirement, DicEffect, DicAutomaticSkillTarget)); }
public override void init(Microsoft.Xna.Framework.Content.ContentManager Content) { if (font == null) { font = Content.Load <SpriteFont>(fontPath); } }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { LifeBar = new DrawableRectangle(new Vector2(MAX_WIDTH, NORMAL_HEIGHT), new Vector2(-MAX_WIDTH / 2f, -NORMAL_HEIGHT / 2f), IsAlly ? Color.Green: Color.DarkRed); AddChild(new DrawableRectangle(new Vector2(MAX_WIDTH + CONTOUR_WIDTH * 2f, NORMAL_HEIGHT + CONTOUR_WIDTH * 2f), new Vector2(-(MAX_WIDTH + CONTOUR_WIDTH * 2f) / 2f, -(NORMAL_HEIGHT + CONTOUR_WIDTH * 2f) / 2f), Color.White)); AddChild(LifeBar); }
public void SetSpriteTextures(Microsoft.Xna.Framework.Content.ContentManager content) { platform = content.Load <Texture2D>("Platform"); character = content.Load <Texture2D>("Character"); flag = content.Load <Texture2D>("Flag"); boulder = content.Load <Texture2D>("Boulder"); }
public override void LoadRes(Microsoft.Xna.Framework.Content.ContentManager cm) { // Define the resource used as background background = new StaticSprite(cm.Load <Texture2D>("test/floor")); // Defines the Tex2D that is used to check for walls wallDef = cm.Load <Texture2D>("test/Test Room Red"); }
public void LoadContent(string ContentFolder3D, Microsoft.Xna.Framework.Content.ContentManager Content) { spawnerModelMesh = Content.Load <Model>(ContentFolder3D + "monsterlarge/MonsterLarge"); var modelEffectSpawner = (BasicEffect)spawnerModelMesh.Meshes[0].Effects[0]; modelEffectSpawner.DiffuseColor = Color.White.ToVector3(); }
public override void InitState(Microsoft.Xna.Framework.Content.ContentManager CM) { ListButtons.Add(new BtnEffSounds(Framework.IDResource.SOUND_Btn_Act, new Microsoft.Xna.Framework.Vector2(130, 120))); ListButtons.Add(new BtnBGSounds(Framework.IDResource.BGSOUND_Btn, new Microsoft.Xna.Framework.Vector2(130, 150))); ListButtons.Add(new BtnReturnMenu(Framework.IDResource.RETURN_Btn, new Microsoft.Xna.Framework.Vector2(130, 180))); base.InitState(CM); }
public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager Content) { base.Initialize(Content); CreateFramesFromXML("ui/ui_frames"); CurrentFrame = "arrow"; ResetDimensions(); }
public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content) { gamePad = new GamePadMapper(PlayerIndex.One); titleDropInFont = new DropInFont(Content.Load <SpriteFont>("Fonts\\JingJingTitle"), new Vector2(_viewPort.Width / 2, _viewPort.Height * 0.1f), new Vector2(_viewPort.Width / 2, _viewPort.Height * 0.1f), dropSpeed, "Game Mode", Color.CornflowerBlue); titleDropInFont.IsVisible = true; titleDropInFont.SetCenterAsOrigin(); titleDropInFont.EnableShadow = false; titleDropInFont.TintColor = Color.Black; titleDropInFont.ShadowPosition = new Vector2(titleDropInFont.Position.X - 4, titleDropInFont.Position.Y + 4); titleDropInFont.ShadowColor = Color.Gray; onePlayerBtn = new Button(Content.Load <Texture2D>("temp 1 player button"), new Vector2(0, 0), Color.White); onePlayerBtn.SetCenterAsOrigin(); onePlayerBtn.Position = new Vector2(_viewPort.Width / 2, titleDropInFont.Position.Y + onePlayerBtn.Origin.Y * 2.5f); twoPlayersBtn = new Button(Content.Load <Texture2D>("temp 2 players button"), new Vector2(0, 0), Color.White); twoPlayersBtn.SetCenterAsOrigin(); twoPlayersBtn.Position = new Vector2(_viewPort.Width / 2, onePlayerBtn.Position.Y + twoPlayersBtn.Origin.Y * 4); backBtn = new Button(Content.Load <Texture2D>("temp back button"), new Vector2(10, 10), Color.CornflowerBlue); backBtn.SetCenterAsOrigin(); backBtn.Position = backBtn.Origin; _sprites.Add(titleDropInFont); _sprites.Add(onePlayerBtn); _sprites.Add(twoPlayersBtn); _sprites.Add(backBtn); }
protected override void LoadContent(DrawState state, Microsoft.Xna.Framework.Content.ContentManager manager) { SpriteFont font = manager.Load <SpriteFont>("Arial"); this.stats.Font = font; this.text.Font = font; //load the particle systems this.fireParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Fire"); this.smokeParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Smoke"); this.burstParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Burst"); //set the trigger for the burst effect ParticleSystemTrigger trigger = this.burstParticleSystem.GetTriggerByName("burst"); for (int i = 0; i < this.burstSources.Length; i++) { this.burstSources[i].SetBurstTrigger(trigger); } //this will only have effect in DEBUG pc builds ParticleSystemHotLoader.Monitor(this.UpdateManager, this.smokeParticleSystem); ParticleSystemHotLoader.Monitor(this.UpdateManager, this.fireParticleSystem); ParticleSystemHotLoader.Monitor(this.UpdateManager, this.burstParticleSystem); }
public virtual void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content) { Roulifont = Content.Load <SpriteFont>("Rouli"); bar = Content.Load <Texture2D>("white_fullscreen"); win = Content.Load <SoundEffect>("music/win"); lose = Content.Load <SoundEffect>("music/lose"); }
public Player(Microsoft.Xna.Framework.Content.ContentManager content) { //Init placeholder image this.sprite = sprite = content.Load <Texture2D>("rsz_photo_1"); this.position = new Vector2(10, 380); this.velocity = new Vector2(0, 0); }
public ContentRepository(Microsoft.Xna.Framework.Content.ContentManager content) { _content = content; _animationDataRepo = new Dictionary<GraphicsEnum, AnimationData> { {GraphicsEnum.Celebrate, GetAnimationData(64, 64, 10, 1, 0.1f, "Graphics/", GraphicsEnum.Celebrate)}, {GraphicsEnum.Player, GetAnimationData(64, 64, 10, 1, 0.1f, "Graphics/", GraphicsEnum.Player)}, {GraphicsEnum.IdleAnimation, GetAnimationData(325, 293, 5, 4, 0.02f, "Graphics/", GraphicsEnum.IdleAnim)}, {GraphicsEnum.EatingAnim, GetAnimationData(325, 294, 5, 3, 0.06f, "Graphics/", GraphicsEnum.EatingAnim)}, {GraphicsEnum.ReadAnim, GetAnimationData(325, 294, 5, 3, 0.06f, "Graphics/", GraphicsEnum.ReadAnim)} }; _staticImageData = new Dictionary<GraphicsEnum, StaticImageData> { {GraphicsEnum.SunCore, GetStaticImageData(175, 175, 0, 0, 0, "Graphics/", GraphicsEnum.SunCore)}, {GraphicsEnum.SunRing, GetStaticImageData(213, 213, 0, 0, 0, "Graphics/", GraphicsEnum.SunRing)}, {GraphicsEnum.CloudOne, GetStaticImageData(77, 120, 0, 40, 3, "Graphics/", GraphicsEnum.CloudOne)}, {GraphicsEnum.CloudTwo, GetStaticImageData(170, 267, 0, 100, 1, "Graphics/", GraphicsEnum.CloudTwo)}, {GraphicsEnum.CloudThree, GetStaticImageData(105, 167, 0, 95, 2, "Graphics/", GraphicsEnum.CloudThree)}, {GraphicsEnum.Moon, GetStaticImageData(188, 187, 0, 0, 0, "Graphics/", GraphicsEnum.Moon)}, {GraphicsEnum.BgDetail, GetStaticImageData(331, 612, 0, 0, 0, "Graphics/", GraphicsEnum.BgDetail)}, {GraphicsEnum.BgGradient, GetStaticImageData(396, 1, 0, 0, 0, "Graphics/", GraphicsEnum.BgGradient)}, {GraphicsEnum.BgGradientNight, GetStaticImageData(396, 1, 0, 0, 0, "Graphics/", GraphicsEnum.BgGradientNight)}, {GraphicsEnum.ComicBubble, GetStaticImageData(229, 331, 0, 0, 0, "Graphics/", GraphicsEnum.ComicBubble)}, {GraphicsEnum.Star1, GetStaticImageData(26, 27, 0, 0, 0, "Graphics/Stars/", GraphicsEnum.Star1)}, {GraphicsEnum.Star2, GetStaticImageData(18, 19, 0, 0, 0, "Graphics/Stars/", GraphicsEnum.Star2)} }; }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.OnLoad(content, gd); if (Structure.Team == Teams.Left) { AddChild(Tower = new DrawableImage("MapObjects/tower1") { RelativeOrigin = new Vector2(0.5f, 0.95f) }, 2); } else { AddChild(Tower = new DrawableImage("MapObjects/tower2") { RelativeOrigin = new Vector2(0.5f, 0.95f) }, 2); AddChild(new ParticleSystem(70, null, new TimeSpan(0, 0, 3)) { Tint = Color.White, ParticleInitialVelocity = new Vector2(5, 20), ParticleForce = new Vector2(-5, 2), Position = new Vector2(0, -135) }, 1); } AddChild(LifeBar = new DrawableTowerLifeBar(Ally) { Position = new Vector2(0f, -Structure.Rectangle.Height * 1.1f), Health = Structure.Health, MaxHealth = Structure.MaxHealth }); }
public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager contentManager, string atlasPath) { const int w = 32; const int h = 32; MusicOn = new Rectangle(0, 0, w, h); SoundFxOn = new Rectangle(w, 0, w, h); MusicOff = new Rectangle(0, h, w, h); SoundFxOff = new Rectangle(w, h, w, h); Texture2D atlas = contentManager.Load <Texture2D>(atlasPath); const int y = Constants.SampleWindowHeight - h - 10; MusicButton = new Button(200, y, w, h); MusicButton.OnlyTriggerOnRelease = true; MusicButton.SourceRectangle = Settings.Music ? MusicOn : MusicOff; SoundFxButton = new Button(220, y, w, h); SoundFxButton.OnlyTriggerOnRelease = true; SoundFxButton.SourceRectangle = Settings.SoundFX ? SoundFxOn : SoundFxOff; BackButton = new Button(20, y, w, h); BackButton.SourceRectangle = new Rectangle(3 * w, 0, w, h); MusicButton.Texture = BackButton.Texture = SoundFxButton.Texture = atlas; }
//Anropar "Load" i texturklassen internal void LoadContent(Microsoft.Xna.Framework.Content.ContentManager a_content) { foreach (Animation sprite in m_spriteTextures) { sprite.Load(a_content); } }
public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content) { foreach (Sprite Sprite in Sprites) { Sprite.Initialize(Content); } }
public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager contentLoader, ComponentManifest manifest) { SkyTexture = contentLoader.Load <TextureCube>((string)(manifest.Properties[ManifestKeys.TEXTURE])); OnEnvironmentMapAdded(EventArgs.Empty); base.Initialize(contentLoader, manifest); }
public void Initialise(Map map, Microsoft.Xna.Framework.Content.ContentManager Content, float gunAngle, Vector2 gunPosition, float destruction, float destructionRange, float range) { explosionScale = .2f; fireScale = .1f; contact = false; Exuasted = false; explosionCount = 0; fireCount = 0; this.range = range; this.map = map; this.range = range; this.gunAngle = gunAngle; this.gunPosition = gunPosition; bulletPosition = gunPosition; this.destruction = destruction; this.destructionRange = destructionRange; bulletSpeed = 5f; bullet = Content.Load <Texture2D>("ball"); WaterSplash = Content.Load <SoundEffect>("WaterSplash"); Explosion = Content.Load <SoundEffect>("Bomb+1"); //Load Explosion Sprites explosion = new Texture2D[12]; for (int num = 0; num < explosion.Length; num++) { explosion[num] = Content.Load <Texture2D>("Explosion_" + num.ToString()); } landingPosition = new Vector2(); CalculateLanding(); }
/// /// Loads all the blocks. /// /// <param name="content">The content manager.</param> public void Load(Microsoft.Xna.Framework.Content.ContentManager content) { foreach (Block b in blocks) { b.Load(content); } }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content, string assetName) { base.LoadContent(content, assetName); heart2 = content.Load <Texture2D>("heartv2"); heart1 = content.Load <Texture2D>("heartv1"); Position = new Microsoft.Xna.Framework.Vector2(0, 0); }
/// <summary> /// Construct (load menus images.) /// </summary> /// <param name="GraphicsDevice"></param> /// <param name="Content"></param> /// <param name="spriteBatch"></param> /// <param name="m_MenuController"></param> public MenuView(GraphicsDevice GraphicsDevice, Microsoft.Xna.Framework.Content.ContentManager Content, SpriteBatch spriteBatch, MenuControlls MenuController) { // TODO: Complete member initialization this.m_graphics = GraphicsDevice; this.Content = Content; this.m_spriteBatch = spriteBatch; this.m_menuController = MenuController; m_MenuTexture = Content.Load <Texture2D>("MenuBackgroundTransp"); m_buttonTexture = Content.Load <Texture2D>("Play2"); m_backToMenuTextue = Content.Load <Texture2D>("menu2"); m_OpitionsTexture = Content.Load <Texture2D>("Options2"); m_PauseTexture = Content.Load <Texture2D>("Pause"); m_HowToPlayTexture = Content.Load <Texture2D>("help"); m_PausedTexture = Content.Load <Texture2D>("PausedBackground"); m_QuitTexture = Content.Load <Texture2D>("ex"); m_ResumeTexture = Content.Load <Texture2D>("ResumeButton"); m_RePlayTexture = Content.Load <Texture2D>("replay3"); m_GameOverTexture = Content.Load <Texture2D>("GameOver"); m_completedTexture = Content.Load <Texture2D>("completed"); m_PlayAginTexture = Content.Load <Texture2D>("PlayAgain"); m_continueTexture = Content.Load <Texture2D>("continueButton"); m_theEndTexture = Content.Load <Texture2D>("theEnd"); }
public MenuScreen(int ScreenWidth, int ScreenHeight, SoundHandler player, GraphicsDeviceManager dMan, Microsoft.Xna.Framework.Content.ContentManager cm) { currentMenuScreen = new MainMenu(ScreenWidth, ScreenHeight, player); currentMenuScreen.gameSelected += gameSelectedHandler; this.dMan = dMan; this.cm = cm; this.mPlayer = player; this.mScreenHeight = ScreenHeight; this.mScreenWidth = ScreenWidth; }
public bool LoadFont(ContentManager content) { try { _font = content.Load<SpriteFont>(_fileName); _ready = true; } catch { return false; } return true; }
/// <summary> /// Maganger to store all sorts of contents /// </summary> /// <param name="xnaContentManager">the xna content manager</param> public ContentManager(Microsoft.Xna.Framework.Content.ContentManager xnaContentManager) { this.fontDatabase = new Dictionary<string, SpriteFont>(); this.textureDatabase = new Dictionary<string, Texture2D>(); this.modelDatabase = new Dictionary<string, Model>(); this.languages = new List<string>(); this.localizationDatabase = new Dictionary<string, string>(); this.randomizer = new Random(); this.xnaContentManager = xnaContentManager; System.Xml.XmlDocument languages = new System.Xml.XmlDocument(); foreach (String language in System.IO.Directory.GetDirectories(@"Content/Locale")) { this.languages.Add(language.Substring(15, language.Length - 15)); // 15 = Content/Locale/ } }
public void Destory() { log.I("LGame 2D Engine Shutdown"); isClose = true; XNAConfig.Dispose(); useXNAListener = false; if (this.sl_listener != null) { this.sl_listener.Dispose(GamePage, true); this.sl_listener = null; } if (UIElementRenderer != null) { UIElementRenderer.Dispose(); UIElementRenderer = null; } if (content != null) { content.Unload(); content = null; } }
private void TryLoadImageData(string contentName, ContentManager nativeContent) { try { LoadImageData(contentName, nativeContent); } catch (Exception ex) { Console.WriteLine("Failed to load texture '" + contentName + "': " + ex); CreateDefaultTexture(); } }
public void Initialize(GameService game) { this.game = game; ContentMgr = new Microsoft.Xna.Framework.Content.ContentManager(game.Services); }
public bool Load(ContentManager content) { if (_ready) return true; try { _texture = content.Load<Texture2D>(_fileName); _ready = true; } catch (System.Exception ex) { Systems.ConsoleWindow.WriteLine("Warning: {0}", ex.Message); return false; } return true; }
private void LoadImageData(string contentName, ContentManager nativeContent) { NativeTexture = nativeContent.Load<Texture2D>(contentName); pixelSize = new Size(NativeTexture.Width, NativeTexture.Height); }
/// <summary> /// Loads the content. /// </summary> /// <param name="xnaContent">Content of the xna.</param> /// <param name="graphicsManager">The graphics manager.</param> public void LoadContent(XnaContentManager xnaContent, IBallerburgGraphicsManager graphicsManager) { if (null != this.content) { return; } content = xnaContent; content.RootDirectory = "Content"; MenuFont = this.content.Load<SpriteFont>("menufont"); DebugColorTexture = this.content.Load<Texture2D>("solidred"); BackgroundTexture = this.content.Load<Texture2D>("Pic2"); MenuTexture = this.content.Load<Texture2D>("Pic4"); GameFont = this.content.Load<SpriteFont>("gamefont"); SkyBox = this.content.Load<SkyBox>(@"Skybox\SkyBox"); GradientTexture = this.content.Load<Texture2D>("Pic3"); MousePointerTexture = this.content.Load<Texture2D>(@"Arrow3"); Castle1 = this.content.Load<Castle>(@"Castles\Castle1"); Castle1.Initialize(graphicsManager.GraphicsDevice); Castle2 = this.content.Load<Castle>(@"Castles\Castle2"); Castle2.Initialize(graphicsManager.GraphicsDevice); Castle3 = this.content.Load<Castle>(@"Castles\Castle3"); Castle3.Initialize(graphicsManager.GraphicsDevice); Castle4 = this.content.Load<Castle>(@"Castles\Castle4"); Castle4.Initialize(graphicsManager.GraphicsDevice); Castle5 = this.content.Load<Castle>(@"Castles\Castle5"); Castle5.Initialize(graphicsManager.GraphicsDevice); Castle6 = this.content.Load<Castle>(@"Castles\Castle6"); Castle6.Initialize(graphicsManager.GraphicsDevice); Castle7 = this.content.Load<Castle>(@"Castles\Castle7"); Castle7.Initialize(graphicsManager.GraphicsDevice); Castle8 = this.content.Load<Castle>(@"Castles\Castle8"); Castle8.Initialize(graphicsManager.GraphicsDevice); ExplosionFrame01 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame01"); ExplosionFrame02 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame02"); ExplosionFrame03 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame03"); ExplosionFrame04 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame04"); ExplosionFrame05 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame05"); ExplosionFrame06 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame06"); ExplosionFrame07 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame07"); ExplosionFrame08 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame08"); CannonTexture = this.content.Load<Texture2D>("Tex8"); KugelMesh = this.content.Load<Model>("SphereNew"); BlankTexture = this.content.Load<Texture2D>("blank"); WhiteTexture = this.content.Load<Texture2D>("WhiteRect"); TerrainTexture = this.content.Load<Texture2D>("Tex1"); CursorTexture = this.content.Load<Texture2D>(@"GUI\cursor"); CannonBallTexture = this.content.Load<Texture2D>(@"SphereFinal"); BackgroundMusicTracks = new Dictionary<string, Song>(); BackgroundMusicTracks.Add("Darkstar", content.Load<Song>(@"Audio\Music1")); BackgroundMusicTracks.Add("HighTension", content.Load<Song>(@"Audio\Music2")); BackgroundMusicTracks.Add("Tentacle", content.Load<Song>(@"Audio\Music3")); BackgroundMusicTracks.Add("DeathRow", content.Load<Song>(@"Audio\Music4")); BackgroundMusicTracks.Add("Boomerang", content.Load<Song>(@"Audio\Music5")); }
public void LoadContent(Microsoft.Xna.Framework.GraphicsDeviceManager dMan, Microsoft.Xna.Framework.Content.ContentManager cm) { mFont = cm.Load<SpriteFont>("font"); mHeaderFont = cm.Load<SpriteFont>("Header"); mBackground.LoadContent(cm, "Menu/menuBG", "Menu/menuBG"); // main buttons this.single_Player_bttn.LoadContent(cm, "Menu/SelectedBackground"); this.multiplayer_bttn.LoadContent(cm, "Menu/SelectedBackground"); this.option_bttn.LoadContent(cm, "Menu/SelectedBackground"); //L2 buttons this.singlePlayer_Dogfight.LoadContent(cm, "Menu/SelectedBackground"); this.singlePlayer_Race.LoadContent(cm, "Menu/SelectedBackground"); this.singlePlayer_Swarm.LoadContent(cm, "Menu/SelectedBackground"); this.multiplayer_internet.LoadContent(cm, "Menu/SelectedBackground"); this.multiplayer_local.LoadContent(cm, "Menu/SelectedBackground"); this.sounds.LoadContent(cm, "Menu/SelectedBackground"); this.button_config.LoadContent(cm, "Menu/SelectedBackground"); this.cm = cm; }
internal ContentManager(MonogameContentManager content) { _content = content; }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager theContentManager) { _contentManager = theContentManager; base.LoadContent(theContentManager); _currentFrameIndex = 0; _totalFrameCount = Rows * Columns; foreach (var projectile in Projectiles) { projectile.LoadContent(theContentManager, _projectileAssetName); } }
/// <summary> /// This loads all the content from the screen also needs to be called once from the main game class /// </summary> /// <param name="con">the content manager that all the screens will use</param> /// <param name="con">the graphics manager that all the screens will use</param> public static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager con, GraphicsDeviceManager grap) { content = con;//stores contenmanager graphics = grap;//stores graphics manager screen[screen.Count - 1].LoadContent(content, graphics);//loadScreen the content for the screen }
/// <summary> /// Disposes the control. /// </summary> protected override void Dispose(bool disposing) { if (graphicsDeviceService != null) { graphicsDeviceService.Release(disposing); graphicsDeviceService = null; } if (_Content != null) { _Content.Dispose(); _Content = null; } base.Dispose(disposing); }
private LSilverlightPlus(Microsoft.Phone.Controls.PhoneApplicationPage page, Microsoft.Xna.Framework.Content.ContentManager c, OnMainEvent main) : base() { isClose = false; numformat = new NumberFormatInfo(); numformat.NumberDecimalSeparator = "."; GamePage = page; try { Microsoft.Phone.Shell.SystemTray.IsVisible = false; } catch (Exception) { } content = c; content.RootDirectory = ""; TargetElapsedTime = new GameTimer(); TargetElapsedTime.UpdateInterval = TimeSpan.FromTicks(333333); TargetElapsedTime.Update += OnUpdate; TargetElapsedTime.Draw += OnDraw; if (useXNAListener) { sl_listener.Create(GamePage); } log.I("LGame 2D Engine Start"); Initialize(); XNA_Graphics_Loading(); if (main != null) { main(this); } }