public Chart2DSpriteContainer(SpriteSet<UVColorVertexData> sprites, FontGeometry fontGeo, VertexSurface<FastChart2DBarVertex> fastBarSurface = null) { this.line = (Sprite2DGeometry)sprites["line"].Geometry; this.point = (Sprite2DGeometry)sprites["point"].Geometry; this.surface = sprites.Surface; this.quadUV = sprites["quad"].Geometry.UV; this.font = fontGeo; this.ThinLineWidth = 0.015f; this.ThickLineWidth = 0.03f; this.SmallPointSize = 0.03f; this.LargePointSize = 0.1f; this.Color = Color.DeepPink; if (fastBarSurface != null) { this.fastBarSurface = fastBarSurface; this.fastBarSurface.AddSettings(sprites.Surface.Settings); this.fastBarSurface.AddSettings( new Vector2Uniform("uv01", this.quadUV.TopLeft), new Vector2Uniform("uv11", this.quadUV.TopRight), new Vector2Uniform("uv00", this.quadUV.BottomLeft), new Vector2Uniform("uv10", this.quadUV.BottomRight) ); } }
/// <summary> /// Initializes a new instance of the <see cref="FontGeometry"/> class. /// </summary> /// <param name="surface">The surface to use for drawing</param> /// <param name="font">The <see cref="Font"/> used</param> public FontGeometry(IndexedSurface<UVColorVertexData> surface, Font font) { this.Surface = surface; this.Font = font; this.SizeCoefficient = Vector2.One; this.UnitTransformation = Matrix3.Identity; }
public Layer(ISurfaceShader shader, ISurfaceShader wispShader, CrepuscularRayGeometry rayGeo, string filename, float brightness, int wisps) { this.rayGeo = rayGeo; var texture = new Texture("gfx/" + filename + ".png", true); this.surface = new PostProcessSurface(); this.surface.AddSettings( new TextureUniform("diffuseTexture", texture), new ColorUniform("color", Color.GrayScale((byte)(255 * brightness))) ); shader.UseOnSurface(this.surface); this.wispSurface = new IndexedSurface<UVColorVertexData>(); wispShader.UseOnSurface(this.wispSurface); this.wispGeo = new Sprite2DGeometry(this.wispSurface) { Color = Color.White.WithAlpha() }; this.wisps = Enumerable.Range(0, wisps) .Select(i => new Wisp()).ToList(); }
public BuildingGeometry(IndexedSurface<BuildingVertex> surface) { this.surface = surface; }
/// <summary> /// Initializes a new instance of the <see cref="PrimitiveGeometry"/> class. /// </summary> /// <param name="surface">The surface used for drawing.</param> public PrimitiveGeometry(IndexedSurface<PrimitiveVertexData> surface) { this.surface = surface; }