16 "title" :
"VuoSceneText",
34 unsigned int vertexCount = 4;
35 unsigned int elementCount = 6;
37 float *positions, *textureCoordinates;
38 unsigned int *elements;
41 positions[0 * 3 ] = -.5;
42 positions[0 * 3 + 1] = -.5;
43 positions[0 * 3 + 2] = 0;
44 positions[1 * 3 ] = .5;
45 positions[1 * 3 + 1] = -.5;
46 positions[1 * 3 + 2] = 0;
47 positions[2 * 3 ] = -.5;
48 positions[2 * 3 + 1] = .5;
49 positions[2 * 3 + 2] = 0;
50 positions[3 * 3 ] = .5;
51 positions[3 * 3 + 1] = .5;
52 positions[3 * 3 + 2] = 0;
54 textureCoordinates[0 * 2 ] = 0;
55 textureCoordinates[0 * 2 + 1] = 0;
56 textureCoordinates[1 * 2 ] = 1;
57 textureCoordinates[1 * 2 + 1] = 0;
58 textureCoordinates[2 * 2 ] = 0;
59 textureCoordinates[2 * 2 + 1] = 1;
60 textureCoordinates[3 * 2 ] = 1;
61 textureCoordinates[3 * 2 + 1] = 1;
75 for(
int i = 0; i < vertexCount; i++)
77 positions[i * 3 ] += horizontal;
78 positions[i * 3 + 1] += vertical;
82 positions, NULL, textureCoordinates, NULL,
115 unsigned int vertexCount;
118 mesh0 = (VuoPoint2d){ positions[0], positions[1] };
127 h = VuoHorizontalAlignment_Left;
129 h = VuoHorizontalAlignment_Center;
131 h = VuoHorizontalAlignment_Right;
134 v = VuoVerticalAlignment_Top;
136 v = VuoVerticalAlignment_Center;
138 v = VuoVerticalAlignment_Bottom;
150 if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Center, VuoVerticalAlignment_Center))
152 return (VuoPoint2d){0, 0};
156 VuoPoint2d *corners = td->transformedCorners;
159 for (
int i = 0; i < 4; ++i)
161 corners[i].x *= -2. / viewportWidth;
162 corners[i].y *= -2. / viewportWidth;
166 double width = fmax(fabs(corners[2].x - corners[0].x), fabs(corners[3].x - corners[1].x));
167 double height = fmax(fabs(corners[2].y - corners[0].y), fabs(corners[3].y - corners[1].y));
168 if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Left, VuoVerticalAlignment_Top))
173 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Left, VuoVerticalAlignment_Center))
175 (corners[0].x + corners[3].x)/2,
176 -((corners[0].y + corners[3].y)/2 + height/2.)
178 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Left, VuoVerticalAlignment_Bottom))
181 -(corners[3].y + height)
183 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Center, VuoVerticalAlignment_Top))
185 (corners[0].x + corners[1].x)/2 + width/2.,
186 -(corners[0].y + corners[1].y)/2
188 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Center, VuoVerticalAlignment_Bottom))
190 (corners[2].x + corners[3].x)/2 + width/2.,
191 -((corners[2].y + corners[3].y)/2 + height)
193 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Right, VuoVerticalAlignment_Top))
195 corners[1].x + width,
198 else if (a ==
VuoAnchor_make(VuoHorizontalAlignment_Right, VuoVerticalAlignment_Center))
200 (corners[1].x + corners[2].x)/2 + width,
201 -((corners[1].y + corners[2].y)/2 + height/2.)
205 corners[2].x + width,
206 -(corners[2].y + height)