MeshVertexColor(Color)
Docs:
Color of the vertex. This color can be in RGB or RGBA format
Alpha in RGBA has no effect (is always 255). RGB works as it should.
Code: Select all
Procedure CreateText3D(Text.s, Material, Color, Color2= $FFFFFFFF)
Protected Mesh
Mesh=CreateMesh(-1)
For i=0 To Len(Text)-1
c=Asc(Mid(Text, i+1, 1))
cu=c & 15
cv=c >> 4
cuf.f=0.0625 * cu
cvf.f=0.125 * cv
AddMeshVertex(-0.5+i, 0.5, 0)
MeshVertexTextureCoordinate(cuf, cvf)
MeshVertexColor(Color)
AddMeshVertex(0.5+i, 0.5, 0)
MeshVertexTextureCoordinate(cuf+0.0625, cvf)
MeshVertexColor(Color)
AddMeshVertex(-0.5+i, -0.5, 0)
MeshVertexTextureCoordinate(cuf, cvf+0.125)
MeshVertexColor(Color2)
AddMeshVertex(0.5+i, -0.5, 0)
MeshVertexTextureCoordinate(cuf+0.0625, cvf+0.125)
MeshVertexColor(Color2)
AddMeshFace(i*4+0, i*4+2, i*4+1)
AddMeshFace(i*4+1, i*4+2, i*4+3)
Next
FinishMesh()
NormalizeMesh(Mesh)
MaterialBlendingMode(Material, #PB_Material_AlphaBlend)
MaterialAmbientColor(Material, #PB_Material_AmbientColors)
SetMeshMaterial(Mesh, MaterialID(Material))
Entity=CreateEntity(-1, MeshID(Mesh), MaterialID(Material))
FreeMesh(Mesh)
ProcedureReturn Entity
EndProcedure
Edit: Uploaded the Font Texture http://www.RRSoftware.net/uploads/Forum ... shadow.png
Code: Select all
Cam1=CreateCamera(-1, 0, 0, 100, 100)
Code: Select all
Text.s = StrF(Engine3DFrameRate(#PB_Engine3D_Current),2)
If OldText.s<>Text
DeleteText3D(Entity1)
Entity1=CreateText3D(Text.s, FontMaterial1, RGBA(255,0,0,255), RGBA(255,255,0,255))
EntityLocate(Entity1, 0, 60, 300)
ScaleEntity(Entity1, 10, 40, 10)
OldText=Text
EndIf
Text2.s = Str(Zlr)
If OldText2.s<>Text2
DeleteText3D(Entity2)
Entity2=CreateText3D(Text2.s, FontMaterial1, RGBA(255,0,0,127), RGBA(255,255,0,127))
EntityLocate(Entity2, 0, 20, 300)
ScaleEntity(Entity2, 10, 40, 10)
OldText2=Text2
EndIf
Zlr+1
CameraLocate(Cam1, 0, 100, 600)
CameraLookAt(Cam1, EntityX(Entity1), EntityY(Entity1), EntityZ(Entity1))
RR