Hi all.
I'm using DragonFireSDK to make an iPhone app, which means that I can't use any external libraries other than the SDK one. I am trying to get an integer variable for score to a function which will display text on the screen. However, that function takes a char* variable. Here is my code (I've marked the lines that I think matter to the error):
//===============================================
// Example.cpp
//===============================================
#include "DragonFireSDK.h"
#include <math.h>
#include <cstdio>
//===============================================
int BackgroundImage;
int BackgroundView;
int CircleImage;
int CircleView;
int ShieldImage;
int ShieldView;
int Blob1Image;
int Blob2Image;
int Blob3Image;
int BlobViews [10];
int LeftArrowImage;
int LeftArrowView;
int RightArrowImage;
int RightArrowView;
int TurnVelocity;
int Angle;
int vX;
int vY;
int Font;
int ScoreText;
int Score; //<<<<THIS LINE
char Score2; //<<<<THIS LINE
//===============================================
int TouchAngle(int id, int event, int x, int y)
{
if (id==1&&event==1)
{
TurnVelocity=-2;
Score-=1;
}
if (id==2&&event==1)
{
TurnVelocity=-2;
Score-=1;
}
if (event==3){TurnVelocity=0;}
return 0;
}
int Translate(int x, int y)
{
return 0;
}
void AppMain()
{
LandscapeMode();
Font = FontAdd("Arial12Bold");
BackgroundImage = ImageAdd("background.png");
BackgroundView = ViewAdd(BackgroundImage, 0, 0);
CircleImage = ImageAdd("circle.png");
CircleView = ViewAdd(CircleImage, 237, 157);
ShieldImage = ImageAdd("shield.png");
ShieldView = ViewAdd(ShieldImage, 200, 150);
LeftArrowImage = ImageAdd("arrow_left.png");
LeftArrowView = ViewAdd(LeftArrowImage, 20, 140);
TouchAdd(0, 60, 50, 320, TouchAngle, 1);
RightArrowImage = ImageAdd("arrow_right.png");
RightArrowView = ViewAdd(RightArrowImage, 435, 140);
TouchAdd(430, 60, 50, 320, TouchAngle, 2);
ScoreText = TextAdd(8, 8, "Score: 0", Font);
Score = 0; //<<<THIS LINE
Angle = 270;
}
//===============================================
void OnTimer()
{
Score2 = Score; //<<<THIS LINE
TextSetText(ScoreText, Score2); //<<<THIS LINE
Angle+=TurnVelocity;
}
//===============================================
I get the error: error C2664: 'TextSetText' : cannot convert parameter 2 from 'char' to 'char *'
Can somebody help me fix this?
Thanks,
Mark :)