• Create Account

### #ActualGameC++Expert93

Posted 28 September 2012 - 06:09 PM

I just spent some time trying to get text working, but I have a problem:
I have a variable in my ball class that keeps the amountofhits, whenever I hit the paddle this increments. But, I don't know how to set my text equal to this variable:
MyString.SetText(variable);
doesn't work. Any Ideas?
(At the moment I am just displaying the number in the console.)

Is SetText a function u created or is it built into whatever game library ur using, if its one u created make sure ur returning the data properly in the function and that your function has the right datatype of string like this

class MyClass{
public:
string SetText();
};


im just assuming ur using a class this goes the same with plain old c++ functions though without a class declaration

### #1GameC++Expert93

Posted 28 September 2012 - 06:03 PM

I just spent some time trying to get text working, but I have a problem:
I have a variable in my ball class that keeps the amountofhits, whenever I hit the paddle this increments. But, I don't know how to set my text equal to this variable:
MyString.SetText(variable);
doesn't work. Any Ideas?
(At the moment I am just displaying the number in the console.)

Is SetText a function u created or is it built into whatever game library ur using

PARTNERS