cassius Posted October 31, 2015 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++
Roland Posted October 31, 2015 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
cassius Posted November 1, 2015 Author 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++
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.