I want to draw the text to a Texture.I have found the
function follows:
void Font::drawTextLine(const String& text, const Vector3& position, const Rect& clip_rect, const ColourRect& colours, float x_scale, float y_scale) const
{
Vector3 cur_pos(position);
float base_y = position.d_y;
uint char_count = text.length();
CodepointMap::const_iterator pos, end = d_cp_map.end();
for (uint c = 0; c < char_count; ++c)
{
pos = d_cp_map.find(text[c]);
if (pos != end)
{
const Image* img = pos->second.d_image;
cur_pos.d_y = base_y - (img->getOffsetY() - img->getOffsetY() * y_scale);
Size sz(img->getWidth() * x_scale, img->getHeight() * y_scale);
img->draw(cur_pos, sz, clip_rect, colours);
cur_pos.d_x += (float)pos->second.d_horz_advance * x_scale;
}
}
}
This function get the image of the text from "d_cp_map" and draw them.But I want to draw the text image to another image and coverter it to a Texture.
How to do this ?I am new to CEGUI .THANKS!!
How to draw the text to a Texture?
Moderators: CEGUI MVP, CEGUI Team
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 3 guests