00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef NL_COMPUTED_STRING_H
00027 #define NL_COMPUTED_STRING_H
00028
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/misc/smart_ptr.h"
00031 #include "3d/primitive_block.h"
00032 #include "3d/driver.h"
00033 #include "3d/vertex_buffer.h"
00034 #include "3d/material.h"
00035 #include <vector>
00036
00037
00038
00039
00040 namespace NL3D {
00041
00042 class CTextureFont;
00043 class CMatrix;
00044 struct CFontDescriptor;
00045
00046
00047
00048
00049
00050
00059 struct CComputedString
00060 {
00061
00062 public:
00063 CVertexBuffer Vertices;
00064 CVertexBuffer VerticesClipped;
00065 CMaterial *Material;
00066 CRGBA Color;
00067 float StringWidth;
00068 float StringHeight;
00069
00070
00071
00072
00073
00074 float StringLine;
00075
00081 enum THotSpot
00082 {
00083 BottomLeft=0,
00084 MiddleLeft,
00085 TopLeft,
00086 MiddleBottom,
00087 MiddleMiddle,
00088 MiddleTop,
00089 BottomRight,
00090 MiddleRight,
00091 TopRight,
00092
00093 HotSpotCount
00094 };
00095
00099 CComputedString()
00100 {
00101 StringWidth = 0;
00102 StringHeight = 0;
00103 Vertices.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
00104 VerticesClipped.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
00105 }
00106
00111 CVector getHotSpotVector(THotSpot hotspot);
00112
00123 void render2D (IDriver& driver,
00124 float x, float z,
00125 THotSpot hotspot = BottomLeft,
00126 float scaleX = 1, float scaleZ = 1,
00127 float rotateY = 0);
00128
00129
00130 void render2DClip (IDriver& driver,
00131 float x, float z,
00132 float xmin=0, float ymin=0, float xmax=1, float ymax=1);
00133
00140 void render3D (IDriver& driver,CMatrix matrix,THotSpot hotspot = MiddleMiddle);
00141
00142 };
00143
00144
00145
00146 }
00147
00148
00149 #endif // NL_COMPUTED_STRING_H
00150
00151
00152