Home > Software engineering >  Questions about the text displayed in the Direct2D
Questions about the text displayed in the Direct2D

Time:03-13

Recently in learning, Direct2D in display text and encounter a problem, ask Daniel to help see
Want to do a similar to the function of the chat window, is a large section of the text
The static const DWRITE_TRIMMING sc_trimming=
{
DWRITE_TRIMMING_GRANULARITY_CHARACTER,
0,
0
};
M_pTextFormat - & gt; SetTrimming (& amp; Sc_trimming, NULL);//text is set to end truncation,
IDWriteTextLayout * pTextLayout=NULL;
PGameApp - & gt; M_pdwriteFactory - & gt; CreateTextLayout (strText c_str (), strText length (), pGameApp - & gt; M_pTextFormat. The Get (), the rect. Right - the rect. Left, the rect. Bottom - the rect. Top, & amp; PTextLayout);
To create a good Layout to the specified location will be displayed after
RenderTarget - & gt; DrawTextLayout (point, pTextLayout pGameApp - & gt; M_pWhiteBrush. The Get ());

The question now is at a specified point always begins with the first word, how to use a scroll bar to control a large section of the text started, according to a certain part is do scrolling effect? Can provide a direction for sure, thank you first
  • Related