Наследование: CanvasLayer
Пример #1
0
 public void RenderContent(RenderLayer context, SpriteBatch spriteBatch)
 {
     _renderCore.RenderContent(context, spriteBatch);
 }
Пример #2
0
 public void RenderContent(RenderLayer context, DrawBatch drawBatch)
 {
     _renderCore.RenderContent(context, drawBatch);
 }
Пример #3
0
 public virtual void RenderContent(RenderLayer context, SpriteBatch spriteBatch)
 {
 }
Пример #4
0
 public virtual void RenderContent(RenderLayer context, DrawBatch drawBatch)
 {
 }
Пример #5
0
 public virtual void RenderCore(RenderLayer context, DrawBatch drawBatch)
 {
 }
Пример #6
0
 public virtual void RenderCore(RenderLayer context, SpriteBatch spriteBatch)
 {
 }
Пример #7
0
 public void RenderCore(RenderLayer context, DrawBatch drawBatch)
 {
     _renderCore.RenderCore(context, drawBatch);
 }
Пример #8
0
 public void RenderCore(RenderLayer context, SpriteBatch spriteBatch)
 {
     _renderCore.RenderCore(context, spriteBatch);
 }
Пример #9
0
            public override void RenderContent(RenderLayer renderContext, SpriteBatch spriteBatch)
            {
                Dictionary<string, Texture2D> brushClassOverlays = _form._brushClassOverlays;
                DynamicTileBrush brush = _form._brush;

                if (!brushClassOverlays.ContainsKey(brush.BrushClass.ClassName)) {
                    System.Drawing.Bitmap overlayBitmap = null;
                    if (brush.BrushClass.ClassName == "Basic")
                        overlayBitmap = Properties.Resources.DynBrushBasic;
                    else if (brush.BrushClass.ClassName == "Extended")
                        overlayBitmap = Properties.Resources.DynBrushExtended;
                    else
                        return;

                    TextureResource overlayResource = TextureResourceBitmapExt.CreateTextureResource(overlayBitmap);
                    brushClassOverlays.Add(brush.BrushClass.ClassName, overlayResource.CreateTexture(spriteBatch.GraphicsDevice));
                }

                Texture2D overlay = brushClassOverlays[brush.BrushClass.ClassName];

                int width = (int)(overlay.Width * renderContext.LevelGeometry.ZoomFactor * (brush.TileWidth / 16.0));
                int height = (int)(overlay.Height * renderContext.LevelGeometry.ZoomFactor * (brush.TileHeight / 16.0));

                Microsoft.Xna.Framework.Rectangle dstRect = new Microsoft.Xna.Framework.Rectangle(0, 0, width, height);
                spriteBatch.Draw(overlay, dstRect, new Microsoft.Xna.Framework.Color(1f, 1f, 1f, .5f));
            }