Font display in ARSA Framework using TTF font, user can download font from any where and bring to loading in program immediately. (done in update or hud function)
// load font, Nithan.ttf is font name, 100 is size // draw font, write code at hud function // You Win!!! is display text // irr::core::recti(10,10,0,0) is boundary of text box 10, 10 is x and y axis // 0, 0 is width and height of box. // irr::video::SColor(255,255,255,100) is color ARGB respectively,255 is opaque // 0 is transparent. arsa_DrawFont(arsa_GetFont("Nithan.ttf", 100 ), "YOU WIN!", irr::core::recti(10,10,0,0), irr::video::SColor(255,255,255,100) );
// 100, 100 is x and y coordinate arsa_DrawFont( arsa_GetFont("Nithan.ttf", 50 ), 100, 100, "Hello World" );
// 100, 200 is x and y axis // This is center text is display text // irr::arsa::EDT_CENTER is draw text alignment flags, value following by // irr::arsa::EDT_CENTER // irr::arsa::EDT_TOP // irr::arsa::EDT_BOTTOM // irr::arsa::EDT_LEFT // irr::arsa::EDT_RIGHT // irr::arsa::EDT_HFLIP // irr::arsa::EDT_VFLIP // irr::arsa::EDT_DEFAULT // flags can orbit // irr::video::SColor(255,0,0,255) is color ARGB respectively, 255 is opaque // 0 is transparent. arsa_DrawFont( arsa_GetFont("Nithan.ttf", 50 ), 100, 200, "This is center text", irr::arsa::EDF_CENTER, irr::video::SColor(255,255,0,255) ); |
- Log in to post comments