public override void LoadContent() { if (fadeBlack) _background = EngineGlobals.AssetManager.CreatePixelTexture("{background}", Color.Black); else _background = EngineGlobals.AssetManager.GetTexture("{load}"); }
public LogoScreen(TextureObject logo, Data.UI.DrawableGameScreen next) : base(true) { EngineGlobals.GameReference.ClearColor = Color.Black; _logoColor = Color.Black; _logo = logo; nextScreen = next; }
public override void Init() { entryComplete = displayComplete = delayComplete = exitComplete = false; _bits = EquestriEngine.AssetManager.GetTexture("{bits}"); _fontDisplay = EquestriEngine.AssetManager.GetFont("{largefont}"); Show(); }
public override void Init() { _windowTarget = EngineGlobals.GameReference.AssetManager.CreateTargetObject("{achievementgenerator" + instanceNumber + "}", WIDGET_WIDTH, WIDGET_HEIGHT); _displayFont = EngineGlobals.GameReference.AssetManager.GetFont("{smallfont}"); _windowTexture = EngineGlobals.GameReference.AssetManager.CreatePixelTexture("{awind_texture}"); _achievementTexture = EngineGlobals.GameReference.AssetManager.GetTexture("{achievement}"); _windowTarget.RunTarget(GenerateWidget); Show(); }
public override void LoadContent() { pony1 = EquestriEngine.AssetManager.CapturedFrame; Objects.Graphics.Misc.TextureLoadList list; Objects.Graphics.Misc.TextureLoadList.LoadList(out list, "debug_BattleScreen"); EquestriEngine.AssetManager.LoadFromLoadList(list); #if DEBUG _battleStage = EquestriEngine.AssetManager.GetTexture("{debug_stage}"); #endif base.LoadContent(); _controller.Init(); }
public static void GenerateTextureObjectFromPopText(out TextureObject output, int num, Color?color = null) { TextureAtlas atlas = EngineGlobals.AssetManager.GetTexture("{pop_text}") as TextureAtlas; string temp = "" + num; int width = 0, height = 0; for (int i = 0; i < temp.Length; i++) { var rect = atlas["num_" + temp[i]]; width += rect.Width; if (rect.Height > height) { height = rect.Height; } } RenderTarget2D _textTarget = new RenderTarget2D(Device_Ref, width, height); Device_Ref.SetRenderTarget(_textTarget); Device_Ref.Clear(color == null ? Color.Black : color.Value); Equestribatch batch = new Equestribatch(Device_Ref); batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); int lastWidth = 0; for (int i = 0; i < temp.Length; i++) { batch.Draw(atlas.Texture, new Vector2(lastWidth, 0), atlas["num_" + temp[i]], Color.White); lastWidth += atlas["num_" + temp[i]].Width; } batch.End(); Device_Ref.SetRenderTarget(null); output = EngineGlobals.AssetManager.CreateTextureObjectFromTarget("{" + temp + "}", _textTarget); _textTarget.Dispose(); }
public void Draw(TextureObject textureObject, Vector2 position, Rectangle? sourceRect, Color color, float rotation, Vector2 origin, Vector2 scale, int effects, float depth) { SpriteEffects sfx; switch (effects) { case 1: sfx = SpriteEffects.FlipHorizontally; break; case 2: sfx = SpriteEffects.FlipVertically; break; case 3: sfx = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; break; default: sfx = SpriteEffects.None; break; } base.Draw(textureObject.Texture, position, sourceRect, color, rotation, origin, scale, sfx, depth); }
public static void GenerateTextureObjectFromPopText(out TextureObject output,int num, Color? color = null) { TextureAtlas atlas = EquestriEngine.AssetManager.GetTexture("{pop_text}") as TextureAtlas; string temp = "" + num; int width = 0, height = 0; for (int i = 0; i < temp.Length; i++) { var rect = atlas["num_" + temp[i]]; width += rect.Width; if (rect.Height > height) height = rect.Height; } RenderTarget2D _textTarget = new RenderTarget2D(Device_Ref,width,height); Device_Ref.SetRenderTarget(_textTarget); Device_Ref.Clear(color == null ? Color.Black : color.Value); Equestribatch batch = new Equestribatch(Device_Ref); batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); int lastWidth = 0; for (int i = 0; i < temp.Length; i++) { batch.Draw(atlas.Texture, new Vector2(lastWidth, 0), atlas["num_" + temp[i]], Color.White); lastWidth += atlas["num_" + temp[i]].Width; } batch.End(); Device_Ref.SetRenderTarget(null); output = EquestriEngine.AssetManager.CreateTextureObjectFromTarget("{"+temp+"}", _textTarget); _textTarget.Dispose(); }
public override void LoadContent() { pony1 = EngineGlobals.AssetManager.CapturedFrame; TextureLoadList list; TextureLoadList.LoadList(out list, "debug_BattleScreen"); EngineGlobals.AssetManager.LoadFromLoadList(list); #if DEBUG _battleStage = EngineGlobals.AssetManager.GetTexture("{debug_stage}"); #endif _controller.Init(); }
public static void GenerateTextureObjectFromMethod(TargetObject input, out TextureObject output,string name, System.Action<Equestribatch> method, Color? color = null,EffectObject effect = null) { input.RunTarget(method,color,effect); output = new TextureObject(name, input.Texture,true); }
public TextureObject CreateTextureObjectFromFile(string name, string file) { if (!_systemReady) throw new EngineException("System not ready for creation", true); if (!_textures.ContainsKey(name)) { TextureObject newTexture = new TextureObject(name, file); _textures[name] = newTexture; _textureLoad = true; return newTexture; } else { return _textures[name]; } }
public void Draw(TextureObject textureObject, Vector2 position, Rectangle? sourceRect, Color color) { base.Draw(textureObject.Texture, position, sourceRect, color); }
public void Draw(TextureObject textureObject, Rectangle destRect, Rectangle? sourceRect, Color color) { base.Draw(textureObject.Texture, destRect, sourceRect, color); }
public TextureObject CreateTextureObjectFromTarget(string name, Microsoft.Xna.Framework.Graphics.RenderTarget2D target) { if (!_systemReady) throw new EngineException("System not ready for creation", true); if (!_textures.ContainsKey(name)) { TextureObject newTexture = new TextureObject(name, target,true); _textures[name] = newTexture; return newTexture; } else { return _textures[name]; } }
public override void LoadContent() { //_messageBoxWindow = Systems.AssetManager.GetTexture("message_box"); if (_messageBoxWindowTexture == null) { _messageBoxWindowTexture = new TextureObject("message_box", @"Graphics\UI\MessageBox"); _nameBoxWindowTexture = new TextureObject("name_box", @"Graphics\UI\namebox"); _continueArrowTexture = new TextureObject("continue_arrow", @"Graphics\UI\textbox_arrow"); } _messageBoxFont = EquestriEngine.AssetManager.GetFont("{largefont}"); boxOrigin = new Vector2(_messageBoxWindowTexture.Width / 2, _messageBoxWindowTexture.Height / 2); name = "Fluttershy"; if (name != null) { _nameBoxWindow = EquestriEngine.AssetManager.CreateTargetObject("{namebox_texture}", (int)_messageBoxFont.Measure(name).X + 50, 74); _nameBoxWindow.RunTarget(DrawNameBox, Color.Transparent); } base.LoadContent(); }
public override void LoadContent() { //_messageBoxWindow = Systems.AssetManager.GetTexture("message_box"); _messageBoxWindowTexture = EngineGlobals.GameReference.AssetManager.CreateTextureObjectFromFile("message_box", @"Graphics\UI\MessageBox"); _nameBoxWindowTexture = EngineGlobals.GameReference.AssetManager.CreateTextureObjectFromFile("name_box", @"Graphics\UI\namebox"); _continueArrowTexture = EngineGlobals.GameReference.AssetManager.CreateTextureObjectFromFile("continue_arrow", @"Graphics\UI\textbox_arrow"); _messageBoxFont = EngineGlobals.GameReference.AssetManager.GetFont("{largefont}"); name = "Fluttershy"; }
public override void LoadContent() { _bubbles = new TextureObject("{bubz}", @"Graphics\UI\menu_bubbles"); _pixel = new TextureObject("{bubz}", @"Graphics\UI\menu_bubbles"); }
private void FromInternal(string texName, string imageName) { using (System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("EquestriEngine.Resources." + imageName + ".png")) { var temp = Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice, stream); var newTex = new TextureObject(texName, temp); _textures[texName] = newTex; } }
protected override void LoadContent() { base.LoadContent(); _systemReady = true; try { FromInternal("{error}", "Error.derpyeyes"); FromInternal("{notex}", "Error.notexture"); FromInternal("{achievement}", "Data.achievements"); FromInternal("{bits}", "UI.bitcollection"); FromInternal("{load}", "Loading.loadingscreen_filler"); var Effect = new Objects.Graphics.BasicEffectObject("{basic_effect}"); var smallFont = new FontObject("{smallfont}", @"fonts\celestia_redux"); _fonts["{smallfont}"] = smallFont; var largeFont = new FontObject("{largefont}", @"fonts\celestia_redux_large"); _fonts["{largefont}"] = largeFont; _frameCapture = new TargetObject("{screen}", GraphicsDevice, EngineGlobals.Settings.WindowWidth, EngineGlobals.Settings.WindowHeight); _empty = CreatePixelTexture("{empty}", Color.Transparent); _singleWhite = CreatePixelTexture("{single}"); } catch (System.Exception ex) { EquestriEngine.ErrorMessage = ex.Message; } LoadTextures(); LoadFonts(); LoadEffects(); LoadSkeletons(); }
public void UnloadTexture(TextureObject texture, bool disposed) { if (disposed) _content.Unload(texture.Texture); _textures.Remove(texture.Name); }
public TextureCollection LoadFromLoadList(Objects.Graphics.Misc.TextureLoadList list) { if (!_systemReady) throw new EngineException("System not ready for creation", true); TextureCollection collection = new TextureCollection(); foreach (var kvp in list.Entries) { switch(kvp.Value[1].ToString()) { case"Atlas": var atlas = new TextureAtlas(kvp.Key, kvp.Value[0].ToString(),kvp.Value[2]); _textures[atlas.Name] = atlas; collection.Add(atlas.Name, atlas); break; case"Texture": var texture = new TextureObject(kvp.Key, kvp.Value[0].ToString()); _textures[texture.Name] = texture; collection.Add(texture.Name, texture); break; case "Target": var target = CreateTargetObject(kvp.Key, (int)((int[])kvp.Value[2])[0], (int)((int[])kvp.Value[2])[1]); _textures[target.Name] = target; collection.Add(target.Name, target); break; } } LoadTextures(); return collection; }
public TextureObject CreateTextureObjectFromTarget(string name, TargetObject target) { if (!_systemReady) throw new EngineException("System not ready for creation", true); if (!_textures.ContainsKey(name)) { TextureObject newTexture = new TextureObject(name, target.Texture); _textures[name] = newTexture; return newTexture; } else { return _textures[name]; } }
protected override void LoadContent() { spriteBatch = new Equestribatch(GraphicsDevice); //_skelebatch = new EquestriSkeleBatch(GraphicsDevice); errorTexture = AssetManager.GetTexture("{error}"); smallFont = AssetManager.GetFont("{smallfont}"); TextureObjectFactory.Device_Ref = GraphicsDevice; base.LoadContent(); }
public static void GenerateTextureObjectFromMethod(TargetObject input, out TextureObject output, string name, System.Action <Equestribatch> method, Color?color = null, EffectObject effect = null) { input.RunTarget(method, color, effect); output = new TextureObject(name, input.Texture, true); }