Page 1 of 1

convert float to String

Posted: Thu Nov 17, 2005 11:40
by pabloa
hi, I would like get into setText one float, scrollbar->getScrollerPosotion to chek one thing in my program. I tried casted

Code: Select all

CEGUI::String s;
s=(CEGUI::String)sb->getScrollPosition();
//and some lines after
scrollbar->setText(s);


the error was cant convert 'float' to 'CEGUI::String'

how can I do it and what conversion are allow?

Re: convert float to String

Posted: Thu Nov 17, 2005 15:28
by lindquist

Code: Select all

#include "CEGUIPropertyHelper.h"

CEGUI::String s = CEGUI::PropertyHelper::floatToString(123.456f);

Re: convert float to String

Posted: Fri Nov 18, 2005 10:47
by pabloa
Thanks it run! but getscrollposition return the origin position and when you move it the float didnt chage.... I would like see news values...