forked from cjcliffe/CubicVR.js
-
Notifications
You must be signed in to change notification settings - Fork 0
TextTexture
cjcliffe edited this page Oct 15, 2011
·
2 revisions
Parameters:
-
text
: A text string, or an array of lines of text. -
options
: Options object.
Options object:
-
options
-
color
: Color, HTML format. (default:#fff
) -
bgcolor
: Background color, HTML format. (optional) -
font
Font. (default:18pt Arial
) align
x
y
width
height
-
From tests/text/text.html:
var textTexture = new CubicVR.TextTexture(['CubicVR.js', 'Rocks!'], {
align: 'center',
font: '18pt Arial'
});
var planeMaterial = new CubicVR.Material({
color: [0, 0, 1],
textures: {
color: textTexture
}
});
var planeMesh = CubicVR.primitives.plane({
size: 1.0,
material: planeMaterial,
uvmapper: {
projectionMode: CubicVR.enums.uv.projection.PLANAR,
projectionAxis: CubicVR.enums.uv.axis.Z,
scale: [1, 1, 1]
}
});
planeMesh.triangulateQuads().compile().clean();
var sceneObject = new CubicVR.SceneObject(planeMesh);
scene.bindSceneObject(sceneObject);