cassius Posted October 31, 2015 Share Posted October 31, 2015 I need to print my main characters health on screen. Can I just print a float or does it have to be converted to string? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Roland Posted October 31, 2015 Share Posted October 31, 2015 DrawText only accepts strings. One example on how to. #include <sstream> void draw_float( Context* c, int x, int y, float val ) { std::ostringstream s; s << val; c->DrawText( s.str(), x, y ); } Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
cassius Posted November 1, 2015 Author Share Posted November 1, 2015 Thanks Roland. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Wedmer Posted November 2, 2015 Share Posted November 2, 2015 Why not to use sprintf family? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.