void plTextGenerator::DrawWrappedString( uint16_t x, uint16_t y, const char *text, uint16_t width, uint16_t height ) { wchar_t *wText = hsStringToWString(text); DrawWrappedString(x,y,wText,width,height); delete [] wText; }
bool plDynamicTextMap::MsgReceive( plMessage *msg ) { plDynamicTextMsg *textMsg = plDynamicTextMsg::ConvertNoRef( msg ); if( textMsg != nil ) { if( textMsg->fCmd & plDynamicTextMsg::kClear ) ClearToColor( textMsg->fClearColor ); if( textMsg->fCmd & plDynamicTextMsg::kSetTextColor ) SetTextColor( textMsg->fColor, textMsg->fBlockRGB ); if( (textMsg->fCmd & plDynamicTextMsg::kSetFont ) && textMsg->fString) SetFont( textMsg->fString, textMsg->fX, (uint8_t)(textMsg->fFlags) ); if( textMsg->fCmd & plDynamicTextMsg::kSetLineSpacing ) SetLineSpacing( textMsg->fLineSpacing ); if( textMsg->fCmd & plDynamicTextMsg::kSetJustify ) SetJustify( (Justify)textMsg->fFlags ); if( textMsg->fCmd & plDynamicTextMsg::kFillRect ) FillRect( textMsg->fLeft, textMsg->fTop, textMsg->fRight - textMsg->fLeft + 1, textMsg->fBottom - textMsg->fTop + 1, textMsg->fColor ); if( textMsg->fCmd & plDynamicTextMsg::kFrameRect ) FrameRect( textMsg->fLeft, textMsg->fTop, textMsg->fRight - textMsg->fLeft + 1, textMsg->fBottom - textMsg->fTop + 1, textMsg->fColor ); if( (textMsg->fCmd & plDynamicTextMsg::kDrawString ) && textMsg->fString) DrawString( textMsg->fX, textMsg->fY, textMsg->fString ); if( (textMsg->fCmd & plDynamicTextMsg::kDrawClippedString ) && textMsg->fString) DrawClippedString( textMsg->fX, textMsg->fY, textMsg->fString, textMsg->fLeft, textMsg->fTop, textMsg->fRight - textMsg->fLeft + 1, textMsg->fBottom - textMsg->fTop + 1 ); if( (textMsg->fCmd & plDynamicTextMsg::kDrawWrappedString ) && textMsg->fString) DrawWrappedString( textMsg->fX, textMsg->fY, textMsg->fString, textMsg->fRight, textMsg->fBottom ); if( textMsg->fCmd & plDynamicTextMsg::kDrawImage ) { plMipmap *mip = plMipmap::ConvertNoRef( textMsg->fImageKey ? textMsg->fImageKey->ObjectIsLoaded() : nil); if( mip != nil ) DrawImage( textMsg->fX, textMsg->fY, mip, textMsg->fFlags ? kImgBlend : kImgNoAlpha ); } if( textMsg->fCmd & plDynamicTextMsg::kDrawClippedImage ) { plMipmap *mip = plMipmap::ConvertNoRef( textMsg->fImageKey ? textMsg->fImageKey->ObjectIsLoaded() : nil); if( mip != nil ) DrawClippedImage( textMsg->fX, textMsg->fY, mip, textMsg->fLeft, textMsg->fTop, textMsg->fRight, textMsg->fBottom, textMsg->fFlags ? kImgBlend : kImgNoAlpha ); } if( textMsg->fCmd & plDynamicTextMsg::kFlush ) FlushToHost(); if( textMsg->fCmd & plDynamicTextMsg::kPurgeImage ) PurgeImage(); return true; } return plMipmap::MsgReceive( msg ); }
void plDynamicTextMsg::DrawWrappedString( int16_t x, int16_t y, uint16_t wrapWidth, uint16_t wrapHeight, const char *text ) { wchar_t *wString = hsStringToWString(text); DrawWrappedString(x,y,wrapWidth,wrapHeight,wString); delete [] wString; }
void plDynamicTextMap::DrawWrappedString( uint16_t x, uint16_t y, const char *text, uint16_t width, uint16_t height, uint16_t *lastX, uint16_t *lastY ) { wchar_t *wText = hsStringToWString(text); DrawWrappedString(x,y,wText,width,height,lastX,lastY); delete [] wText; }