public override void OnEnter() { var penWidth = 6.0f; Pen pen = new Pen(new Microsoft.Xna.Framework.Color(Microsoft.Xna.Framework.Color.Blue, 92), penWidth); var bounds = VisibleBoundsWorldspace; var size = bounds.Size; var width = size.Width - penWidth; var height = size.Height - penWidth; //_cache = new Grid(12, 10).Compile(pen, 3, 3, 30 * 12, 30 * 10); _cache = new Grid(12, 10).Compile(pen, penWidth/2, penWidth/2, width, height); base.OnEnter(); }
/// <summary> /// Immediatley renders a <see cref="DrawCache"/> object. /// </summary> /// <param name="cache">A <see cref="DrawCache"/> object.</param> /// <remarks>Any previous unflushed geometry will be rendered first.</remarks> public void DrawCache (DrawCache cache) { if (_sortMode != DrawSortMode.Immediate) SetRenderState(); FlushBuffer(); cache.Render(_device, _defaultTexture); }
public override void Setup (GraphicsDevice device) { Pen pen = new Pen(new Color(Color.Blue, 92), 6); _cache = new Grid(12, 10).Compile(pen, 30, 30, 30 * 12, 30 * 10); }
/// <summary> /// Immediatley renders a <see cref="DrawCache"/> object. /// </summary> /// <param name="cache">A <see cref="DrawCache"/> object.</param> /// <remarks>Any previous unflushed geometry will be rendered first.</remarks> public void DrawCache(DrawCache cache) { //if (_sortMode != DrawSortMode.Immediate) // SetRenderState(); FlushBuffer(); cache.Render(this, _defaultTexture); }