public override void Draw(gxtGraphicsBatch graphicsBatch) { //camera.Position = Vector2.Zero; //gxtLog.WriteLineV(gxtVerbosityLevel.INFORMATIONAL, camera.Position.ToString()); graphicsBatch.Begin(gxtBatchDrawOrder.PRIMITIVES_FIRST, gxtBatchSortMode.TEXTURE, gxtBatchDepthMode.FRONT_TO_BACK, camera.GetTransform()); sceneGraph.Draw(graphicsBatch); graphicsBatch.End(); }
public override void Draw(gxtGraphicsBatch graphicsBatch) { base.Draw(graphicsBatch); //world.Draw(spriteBatch); }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Matrix transform) { if (material != null) { if (material.Visible) { graphicsBatch.DrawIndexedPrimitives(PrimitiveType.LineList, null, vertexBuffer, indexBuffer, primitiveCount, ref transform, material.RenderDepth); } } else { if (gxtMaterial.DEFAULT_VISIBILITY) { graphicsBatch.DrawIndexedPrimitives(PrimitiveType.LineList, null, vertexBuffer, indexBuffer, primitiveCount, ref transform, gxtMaterial.DEFAULT_RENDER_DEPTH); } gxtLog.WriteLineV(gxtVerbosityLevel.WARNING, "No material attached to an instance of gxtLineList! Pos: {0, 1}", transform.M14, transform.M24); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
/// <summary> /// Draws the scene using the graphics batch if the scene is visible /// </summary> /// <param name="graphicsBatch"></param> public void Draw(gxtGraphicsBatch graphicsBatch) { gxtDebug.Assert(gxtRoot.Singleton.EngineState == gxtEngineState.DRAW, "You can only draw the scene graph during the draw engine state!"); if (sceneVisible) root.Draw(graphicsBatch); }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Vector2 position, float rotation, ref Vector2 scale, SpriteEffects spriteEffects) { if (material != null) { if (material.Visible) { graphicsBatch.DrawIndexedPrimitives(PrimitiveType.LineList, null, vertexBuffer, indexBuffer, primitiveCount, ref position, ref scale, rotation, spriteEffects, material.RenderDepth); } } else { if (gxtMaterial.DEFAULT_VISIBILITY) { graphicsBatch.DrawIndexedPrimitives(PrimitiveType.LineList, null, vertexBuffer, indexBuffer, primitiveCount, ref position, ref scale, rotation, spriteEffects, gxtMaterial.DEFAULT_RENDER_DEPTH); } gxtLog.WriteLineV(gxtVerbosityLevel.WARNING, "No material attached to an instance of gxtLineList! Pos: {0, 1}", position.X, position.Y); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Vector2 position, float rotation, ref Vector2 scale, SpriteEffects spriteEffects) { if (material != null) { if (material.Visible) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, texture, vertexBuffer, indexBuffer, primitiveCount, ref position, ref scale, rotation, spriteEffects, material.RenderDepth); } else { if (gxtMaterial.DEFAULT_VISIBILITY) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, texture, vertexBuffer, indexBuffer, primitiveCount, ref position, ref scale, rotation, spriteEffects, gxtMaterial.DEFAULT_RENDER_DEPTH); gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "No material attached to an instance of gxtMesh! Pos: {0, 1}", position.X, position.Y); } }
/// <summary> /// This is called when the screen should draw itself. /// </summary> public abstract void Draw(gxtGraphicsBatch graphicsBatch);
public override void Draw(gxtGraphicsBatch graphicsBatch) { }
public override void Draw(gxtGraphicsBatch graphicsBatch) { // shouldn't draw if covered world.Draw(graphicsBatch); }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Vector2 position, float rotation, ref Vector2 scale, SpriteEffects spriteEffects) { if (material != null) { if (material.Visible) { if (circleDrawMode == gxtCircleDrawMode.CIRCLE) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleTexture, vertexBuffer, gxtPrimitiveManager.Singleton.QuadIndexBuffer, 2, ref position, ref scale, rotation, spriteEffects, material.RenderDepth); else graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleShellTexture, vertexBuffer, gxtPrimitiveManager.Singleton.QuadIndexBuffer, 2, ref position, ref scale, rotation, spriteEffects, material.RenderDepth); } } else { if (gxtMaterial.DEFAULT_VISIBILITY) { if (circleDrawMode == gxtCircleDrawMode.CIRCLE) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleTexture, vertexBuffer, indexBuffer, 2, ref position, ref scale, rotation, spriteEffects, gxtMaterial.DEFAULT_RENDER_DEPTH); else graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleShellTexture, vertexBuffer, indexBuffer, 2, ref position, ref scale, rotation, spriteEffects, gxtMaterial.DEFAULT_RENDER_DEPTH); } gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "No material attached to an instance of gxtCircle! Pos: {0, 1}", position.X, position.Y); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Matrix transform) { if (material != null) { if (material.Visible) { if (circleDrawMode == gxtCircleDrawMode.CIRCLE) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleTexture, vertexBuffer, indexBuffer, 2, ref transform, material.RenderDepth); else graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleShellTexture, vertexBuffer, indexBuffer, 2, ref transform, material.RenderDepth); } } else { if (gxtMaterial.DEFAULT_VISIBILITY) { if (circleDrawMode == gxtCircleDrawMode.CIRCLE) graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleTexture, vertexBuffer, indexBuffer, 2, ref transform, gxtMaterial.DEFAULT_RENDER_DEPTH); else graphicsBatch.DrawIndexedPrimitives(PrimitiveType.TriangleList, gxtPrimitiveManager.Singleton.CircleShellTexture, vertexBuffer, indexBuffer, 2, ref transform, gxtMaterial.DEFAULT_RENDER_DEPTH); } gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "No material attached to an instance of gxtCircle! Pos: {0, 1}", transform.M14, transform.M24); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Matrix transform) { if (material != null) { if (material.Visible) graphicsBatch.DrawUserIndexedPrimitives(primitiveType, texture, vertices, indices, primitiveCount, ref transform, material.RenderDepth); } else { if (gxtMaterial.DEFAULT_VISIBILITY) graphicsBatch.DrawUserIndexedPrimitives(primitiveType, texture, vertices, indices, primitiveCount, ref transform, gxtMaterial.DEFAULT_RENDER_DEPTH); gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "No material attached to the indexed primitive! Pos: {0, 1}", transform.M14, transform.M24); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Vector2 position, float rotation, ref Vector2 scale, SpriteEffects spriteEffects) { if (material != null) { if (material.Visible) graphicsBatch.DrawUserIndexedPrimitives(primitiveType, texture, vertices, indices, primitiveCount, ref position, ref scale, rotation, spriteEffects, material.RenderDepth); } else { if (gxtMaterial.DEFAULT_VISIBILITY) graphicsBatch.DrawUserIndexedPrimitives(primitiveType, texture, vertices, indices, primitiveCount, ref position, ref scale, rotation, spriteEffects, gxtMaterial.DEFAULT_RENDER_DEPTH); gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "No material attached to the indexed primitive! Pos: {0, 1}", position.X, position.Y); // draw NO MATERIAL with the debug drawer's debug spritefont? } }
/// <summary> /// Draws everything in the world scene graph relative to the camera /// </summary> /// <param name="spriteBatch">SpriteBatch</param> public virtual void Draw(gxtGraphicsBatch graphicsBatch) { gxtDebug.SlowAssert(IsInitialized() && sceneGraph.IsInitialized()); graphicsBatch.Begin(gxtBatchDrawOrder.PRIMITIVES_FIRST, gxtBatchSortMode.TEXTURE, gxtBatchDepthMode.FRONT_TO_BACK, camera.GetTransform()); sceneGraph.Draw(graphicsBatch); graphicsBatch.End(); }
public void Draw(gxtGraphicsBatch graphicsBatch, ref Matrix transform) { if (spriteFont != null) { if (material != null) { if (material.Visible) graphicsBatch.DrawString(spriteFont, text, material.ColorOverlay, ref origin, ref transform, material.RenderDepth); } else { if (gxtMaterial.DEFAULT_VISIBILITY) graphicsBatch.DrawString(spriteFont, text, gxtMaterial.ERROR_TEXT_COLOR_OVERLAY, ref origin, ref transform, gxtMaterial.DEFAULT_RENDER_DEPTH); } } else { gxtLog.WriteLineV(gxtVerbosityLevel.CRITICAL, "Drawable Text Field Does Not Have A Sprite Font (Position {0}, Text: {1})", transform.Translation.ToString(), text); if (gxtDebugDrawer.SingletonIsInitialized) { SpriteFont debugFont = gxtDebugDrawer.Singleton.DebugFont; if (debugFont != null) { string errorMsg = "NO SPRITEFONT"; Vector2 errorMsgOrigin = debugFont.MeasureString(errorMsg) * 0.5f; graphicsBatch.DrawString(debugFont, errorMsg, gxtMaterial.ERROR_COLOR_OVERLAY, ref errorMsgOrigin, ref transform, 0.0f); } } } }
/// <summary> /// New draw method, designed to be used in conjunction with more efficient updates /// </summary> /// <param name="spriteBatch">SpriteBatch</param> public virtual void Draw(gxtGraphicsBatch graphicsBatch) { // world matrices are faster for everything except text, which has to // decompose it to play nicely with spritebatch for (int i = 0; i < NumDrawables; ++i) { drawables[i].Draw(graphicsBatch, ref derivedTransform); } // do the same for all the children for (int i = 0; i < NumChildrenNodes; ++i) { children[i].Draw(graphicsBatch); } }