public SimpleUIPointSpriteStringElement(IUILayoutParam param, string content, vec3 position, GLColor color = null, int fontSize = 32, int maxRowWidth = 256, FontResource fontResource = null) { IUILayout layout = this; layout.Param = param; this.element = new PointSpriteStringElement(content, position, color, fontSize, maxRowWidth, fontResource); }
private void FormPointSpriteStringElement_Load(object sender, EventArgs e) { this.camera = new ScientificCamera(CameraTypes.Perspecitive); this.rotator = new SatelliteRotation(this.camera); //this.fontElement = new PointSpriteStringElement(this.camera, "A", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "AAAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); this.fontElement = new PointSpriteStringElement( this.camera, "AAAAAAAAAAAAAAAA", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "hi text!", new SharpGL.SceneGraph.Vertex(0, 0, 0)); //this.fontElement = new PointSpriteStringElement(this.camera, "qwertyuiop[]", new SharpGL.SceneGraph.Vertex(0, 0, 0)); this.fontElement.Initialize(this.openGLControl.OpenGL); }
private void btnUpdateText_Click(object sender, EventArgs e) { string text = this.txtText.Text; GLColor color = this.lblFontColor.BackColor; int fontSize = (int)this.numFontSize.Value; int maxRowWidth = (int)this.numMaxRowWidth.Value; //if (this.textElement == null) { var textElement = new PointSpriteStringElement(text, new vec3(0, 1, 0), color, fontSize, maxRowWidth, null); textElement.Initialize(); this.textElement = textElement; } //else //{ // var textElement = this.textElement; // textElement.UpdateProperties(text, color, fontSize, null); //} }