void Start(){
		
		// The text-extrude API is experimental and therefore unstable and unoptimised.
		// This example is provided straight from our test bench as a preview of what PowerUI 2 is capable of.
		
		// We're going to increase the curve accuracy - this results in smoother curves.
		// This of course means more triangles, but this text is the only thing here anyway.
		// TextExtrude.CurveAccuracy/=10f;
		
		
		// Create a WorldUI:
		WorldUI ui=new WorldUI();
		
		// Let's give it some space - this will affect the wrapping of the text:
		ui.SetDimensions(500,100);
		
		// Define the resolution - that's how many pixels per world unit.
		// This of course entirely depends on the usage.
		ui.SetResolution(10);
		
		if(Html==null){
			Debug.Log("No HTML file defined for 3D text!");
			return;
		}
		
		// Apply the content:
		ui.document.innerHTML="<div style='text-extrude:4;font-size:30px;height:100%;vertical-align:middle;text-align:center;font-family:Hardwood;'>"+Html.text+"</div>";
		
	}
Пример #2
0
	// Use this for initialization
	void Start () {
		
		// Next, generate a new UI:
		WorldUI ui=new WorldUI("TVScreenContent");
		
		// It's representing a TV, so lets use some standard TV screen dimensions:
		ui.SetDimensions(800,600);
		
		// But we need to define the resolution - that's how many pixels per world unit.
		// This of course entirely depends on the model and usage.
		ui.SetResolution(540,610);
		
		// As this example only uses a WorldUI, we'll set the filter mode to bilinear so it looks smoother.
		ui.TextFilterMode=FilterMode.Bilinear;
		
		// Give it some content:
		if(HtmlFile!=null){
			ui.document.innerHTML=HtmlFile.text;
		}
		
		// Parent it to the TV:
		ui.transform.parent=transform;
		
		// Let's move it around a little too:
		ui.transform.localPosition=new Vector3(0f,1.02f,0.03f);
		
		// And spin it around - the TV mesh is facing the other way:
		ui.transform.localRotation=Quaternion.AngleAxis(180f,Vector3.up);
		
		if(InputEnabled){
			// World UI's should accept input:
			UI.WorldInputMode=InputMode.Screen;
		}
		
	}