Autor Beitrag
christian87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mi 21.02.07 20:11 
Hi,

Ich lasse ein kleines image(Ball) über ein große image(Spielfeld) wandern. Der Ball ist ein Sprite. Wenn ich das Sprite zeichne will ich, dass das vorher gezeichnete verschwindet. Kann ich jetzt einfach das Spielfeld nochmal laden?

Ich hab es so probiert:

Funktioniert aber leider nicht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
drawsprite(image4.canvas,image1,image3,bx,by);

 bitmap:=Tbitmap.create;
 bitmap.assign(image4.Picture);
 image4.canvas.Draw(0,0,bitmap);
.50AE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Do 22.02.07 12:07 
Hi,

wenn ich dich richtig verstanden habe, soll das wohl irgendein Spiel werden, oder?
Und der "Ball" soll sich übers Spielfeld bewegen.

Da würde ich an deiner Stelle einfach die Position des Images ändern und nicht den Ball die ganze zeit neu zeichnen.

Falls du das trotzdem machen willst, kannst du das Image so "löschen":
ausblenden Delphi-Quelltext
1:
Image1.Picture := nil;					


Wobei eine Paintbox dann vllt angebrachter wäre.

MfG
50ae
christian87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 22.02.07 15:37 
Also...

Das Spiel wir ein Minigolfspiel. Der Ball ist ein image, den ich als Sprite umgewandelt habe. Das Spielfeld ist ein Bitmap, welches ich in Photoshop erstellt habe. Also ein grafisches Spielfeld. Jetzt lasse ich den Ball über dieses Spielfeld wandern und sehe eine "Spur von Bällen".
Vorher hatte ich noch kein Bild geladen, sondern einen weißen Untergrund und habe einfach das ganze image weiß gefärbt. Das hat super geklappt. Aber mit dem Bild klappt es leider nicht.

Es gibt bestimmt eine einfache Lösung. Hab auch hier im Forum schon etwas gelesen. Aber es will einfach nicht klappen.
.50AE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Do 22.02.07 17:05 
user profile iconchristian87 hat folgendes geschrieben:
Jetzt lasse ich den Ball über dieses Spielfeld wandern und sehe eine "Spur von Bällen".


Wie wandert er denn übers Spielfeld?
Wenn du das Image einfach verschiebst müsste es doch eigentlich gehen

MfG
50ae