Autor Beitrag
Blitz.XP
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Sa 10.07.04 10:42 
hallo

also erstmal scheint das hier ja ein ganz nettes Forum zu sein, aba nun zur frage:

Ich hab hier den Queltext aus dem Delphitreff Tutorial für delphiX:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DXClass, DXSprite, DXDraws, DXInput;

type
  TForm1 = class(TForm)
    DXDraw1: TDXDraw;
    DXImageList1: TDXImageList;
    DXSpriteEngine1: TDXSpriteEngine;
    DXTimer1: TDXTimer;
    DXInput1: TDXInput;
    procedure FormCreate(Sender: TObject);
    procedure DXTimer1Activate(Sender: TObject);
    procedure DXTimer1Timer(Sender: TObject; LagCount: Integer);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

TAnimation = class(TImageSprite)
public
  procedure DoMove(MoveCount: Integer); override; {war schon da}
  constructor Create(AParent: TSprite ); override; {war schon da}
  procedure DoCollision(Sprite: TSprite; var Done: Boolean); override;
end;

TGegenstand = class(TImageSprite)
public
constructor Create(AParent: TSprite ); override;
end;


var
  Form1: TForm1;
  ani: TAnimation;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  with TAnimation.Create(DXSpriteEngine1.Engine) do
  begin
    x:=0;
    y:=0;
  end;
    with TGegenstand.Create(DXSpriteEngine1.Engine) do
    begin
      x:=500;
      y:=500;
      pixelcheck := true;
    end;
end;

constructor TGegenstand.Create(AParent: TSprite );
begin
  inherited Create(AParent);
  Image:=Form1.DXImageList1.Items.Find('Stein');
  Width := Image.Width;
  Height := Image. Height;
  Visible:=True;
  end;


procedure TForm1.DXTimer1Activate(Sender: TObject);
begin
  DXSpriteEngine1.Move(1);
  DXDraw1.Surface.Fill(0);
  DXSpriteEngine1.Draw;
  DXDraw1.Flip;

end;

procedure TAnimation.DoMove(MoveCount: Integer);
begin
  inherited DoMove(MoveCount);
  If isUp in Form1.DXInput1.States Then 
    Y := Y -10;
  If isDown in Form1.DXInput1.States
    Then Y := Y + 10;
  If isLeft in Form1.DXInput1.States Then 
    X := X -10;
  If isRight in Form1.DXInput1.States Then 
    X := X +10;
  Collision;
end;

constructor TAnimation.Create(AParent: TSprite );
begin
  inherited Create(AParent); 
  Image:=Form1.DXImageList1.Items.Find('1');
  Width :=Image.Width;
  Height :=Image. Height;
  Visible:=True;


end; 


procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
  DXInput1.Update;
  DXSpriteEngine1.Move(1);
  DXDraw1.Surface.Fill(0);
  DXSpriteEngine1.Draw;
  DXDraw1.Flip;

end;

procedure TAnimation.DoCollision(Sprite: TSprite; var Done: Boolean);
begin
  if sprite is TGegenstand then
    begin
      if not done then beep;
      done := true;
      dead;
    end;
end;


end.


So. Jetzt will cih wissen, ob es so irgendwie möglich ist die animation zu drehen?
Wäre ett wenn mir hier schnell jemand antworten würde. Danke!

Johannes
Blitz.XP Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Sa 10.07.04 15:47 
Also wenn das hier keiner weiß (oder der betreffende das Thema noch nich angeguckt hat), dann frag ich halt mal andersrum:
is es möglich in ani.IMage ein gedrehtes Bild zu zeichnen?

Danke für (möglichst schnelle) Antowrten!

Johannes
Blitz.XP Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Sa 10.07.04 21:20 
hm des kann doch nicht sein dass das hier keiner weis, oder?
Also eigentlich müsste ich nur in das IMage von ani (Tanimation) ein gedrehtes Image (am besten aus einer DXImagelist) zeichnen. Ich probier hier nämlich grad die ganze Zeit rum und komm net weiter.

Johannes