/* Irrlicht Library Wrapper Created by: Nathan Adams Copyright (C) 2008 This software is licensed under the GNU/GPL. This software may not be used for commerical purposes. */ #include #include "IrrText.h" #include #include #include "IrrDevices.h" using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; using namespace std; IrrText::IrrText() { //counter = 0; //this->setText("No Text"); this->str = "No Text"; this->Move(0,0); } IrrText::IrrText(irr::core::stringw str) { //counter = 0; this->str = str; //this->setText(str); this->Move(0,0); } void IrrText::Move(float x, float y) { this->x = x; this->y = y; } /*void IrrText::setText(irr::core::stringw str) { int offset = 0; irr::core::position2d destPos(this->x, this->y); this->text.clear(); for(unsigned int i = 0; i < str.size(); i++) switch (str[i]) { case '0': #ifdef IRRDEBUG cout << "0" << endl; #endif //this->text.push_back(IrrDevices::driver->getTexture("0.png")); break; case '1': #ifdef IRRDEBUG cout << "1" << endl; #endif break; case '2': #ifdef IRRDEBUG cout << "2" << endl; #endif break; case '3': #ifdef IRRDEBUG cout << "3" << endl; #endif break; case '4': #ifdef IRRDEBUG cout << "4" << endl; #endif break; case '5': #ifdef IRRDEBUG cout << "5" << endl; #endif break; case '6': #ifdef IRRDEBUG cout << "6" << endl; #endif break; case '8': #ifdef IRRDEBUG cout << "7" << endl; #endif break; case '9': #ifdef IRRDEBUG cout << "8" << endl; #endif break; default: cout << "Unrecongized Character!" << endl; break; } }*/ float IrrText::getX() { return this->x; } float IrrText::getY() { return this->y; } char IrrText::getChar(int charLoc) { return this->str[charLoc]; } void IrrText::setX(float x) { this->x = x; } void IrrText::setY(float y) { this->y = y; } void IrrText::Set(irr::core::stringw str) { this->str = str; } void IrrText::Set(int num) { char tmp[10]; //itoa(num, tmp, 10); sprintf(tmp, "%d", num); this->str = tmp; } int IrrText::size() { return this->str.size(); } /*void IrrText::resetCounter() { this->counter = 0; }*/