Ejemplo n.º 1
0
        public void drawInEditor(SpriteBatch spriteBatch)
        {
            if (!isVisible)
            {
                return;
            }

            foreach (LevelObject lo in loList)
            {
                if (lo is DrawableLevelObject)
                {
                    DrawableLevelObject dlo = (DrawableLevelObject)lo;
                    if (dlo.isVisible)
                    {
                        dlo.drawInEditor(spriteBatch);
                    }
                }
            }

            if (particleRenderer == null)
            {
                particleRenderer = new ParticleRenderer(_graphicsM);
                particleRenderer.drawParticlesInEditor(_contentM);
            }
            particleRenderer.drawParticlesInEditor(_contentM);
        }
Ejemplo n.º 2
0
 public void loadContentInEditor(GraphicsDevice graphics)
 {
     foreach (LevelObject lo in loList)
     {
         if (lo is DrawableLevelObject)
         {
             DrawableLevelObject dlo = (DrawableLevelObject)lo;
             dlo.loadContentInEditor(graphics);
         }
     }
 }
Ejemplo n.º 3
0
        public void drawLayer(SpriteBatch spriteBatch)
        {
            foreach (LevelObject lo in loList)
            {
                if (lo is DrawableLevelObject)
                {
                    DrawableLevelObject dlo = (DrawableLevelObject)lo;

                    if (dlo.isVisible)
                    {
                        dlo.Draw(spriteBatch);
                    }
                }
            }

            particleRenderer.drawParticles();
        }
Ejemplo n.º 4
0
        public void drawInEditor(SpriteBatch spriteBatch)
        {
            if (!isVisible)
            {
                return;
            }

            foreach (LevelObject lo in loList)
            {
                if (lo is DrawableLevelObject)
                {
                    DrawableLevelObject dlo = (DrawableLevelObject)lo;
                    if (dlo.isVisible)
                    {
                        dlo.drawInEditor(spriteBatch);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public void loadContentInEditor(GraphicsDeviceManager graphicsM, GraphicsDevice graphics, ContentManager content)
        {
            particleRenderer = new ParticleRenderer(graphicsM);
            particleRenderer.particleRenderer.LoadContent(content);
            this._graphicsM = graphicsM;
            this._contentM  = content;
            Rt = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height);

            foreach (LevelObject lo in loList)
            {
                if (lo is DrawableLevelObject)
                {
                    DrawableLevelObject dlo = (DrawableLevelObject)lo;
                    try
                    {
                        dlo.loadContentInEditor(graphics);
                    }
                    catch (Exception e)
                    {
                        DebugLogManager.writeToLogFile("Wasn't able to load " + dlo.name + " in Layer " + this.name);
                    }
                }
                else if (lo is ParticleObject)
                {
                    ParticleObject p = (ParticleObject)lo;
                    particleRenderer.addParticleObjectsInEditor(p, content);
                }
            }

            particleRenderer.initializeParticlesInEditor(content);
            if (Effects == null)
            {
                Effects = new List <EffectObject>();
            }

            foreach (EffectObject eo in Effects)
            {
                //eo.Initialise();
                eo.loadContentInEditor(graphics, content);
            }
        }