Witam,
mam problem i prosiłbym o w miarę szybką odpowiedź :oops:
Otóż robię sobie gierkę na androida (tj. w javie w rokonie), no i robię sobie obiekt Text Sprite żeby wyświetlić tekst #-o
public class ScenaGry extends Scene {
//private FixedBackground tlo;
int czystrzelac;
private Sprite tor;
private Sprite zaw;
private TextSprite moj_tekst;
//private static final String TAG = "MyActivity" ;
public ScenaGry(){
super(1, 3);
moj_tekst = new TextSprite(290, 450, 60, 60);
moj_tekst.setText("blablabla");
//moj_tekst.getText(123455);
zaw = new Sprite(100, 50, Tekstury.zaw.getWidth(), Tekstury.zaw.getHeight());
zaw.setTexture(Tekstury.zaw);
tor = new Sprite(-400, -300, Tekstury.tor.getWidth(), Tekstury.tor.getHeight());
tor.setTexture(Tekstury.tor);
//Log.i(TAG,"Czy wyswietlisz cos?");
add(0, zaw);
add(0, tor);
add(0, moj_tekst);
}
@Override
public void onGameLoop() {
}
@Override
public void onTouchDown(float x, float y, MotionEvent event, int pointerCount, int pointerId)
{
}
@Override
public void onTouchMove(float x, float y, MotionEvent event, int pointerCount, int pointerId)
{
// This is called when you move your finger over the screen. (ie pretty much every frame if your holding your finger down)
// Here we'll basically just make Bob follow your finger.
zaw.x = x - (Tekstury.zaw.getWidth()/2);
zaw.y = y - (Tekstury.zaw.getHeight()/2);
//moj_tekst.x = x - (300/2);
//moj_tekst.y = y - (470/2);
}
@Override
public void onTouchUp(float x, float y, MotionEvent event, int pointerCount, int pointerId)
{
}
@Override
public void onPause() {
}
@Override
public void onResume() {
}
@Override
public void onReady() {
}
}
No i co robię źle? Dlaczego textSprite mi się nie wyświetla?
Sprity działają normalnie no a ten textSprite nie chce się wyświetlić…
Z góry dzieki!