Quote Originally Posted by Proph3t View Post
Wave.dcu is included with DelphiX I think, if you want I could attach it with a future post?
DelphiX comes with DXWave.pas. Now I don't know if it is the same as the Wave.dcu that you are using. Atach it the next post and I'll check it out.


Quote Originally Posted by Proph3t View Post
I also thought that something with that code seemed wrong but couldnt lay my finger on it. I got that code from a tutorial on which I am expanding.
I know the tutorial which you are using. I have read it a while ago. At that time the provided code was fine but there was some changes made in UniDelphiX is the code should probably be updated a bit especially about "DXDraw1.Beginscene" And "DXDraw1.Endscene". which are used to group multiple draw cals. This should provide some performance increase and solve some graphical glitches that sometimes ocured in original DelphiX component set.


Quote Originally Posted by Proph3t View Post
I found that the TImageSprite has a Image property which is a TPictureCollectionItem. Although, I cannot understand how it will be any different if I use the Image property? It still has to load images from a DXImagelist, doesnt it? Unless what you meant was that by using "Player.SpriteImage.LoadfromGraphic" It has to load the image into graphic memory, is this correct? Cause by using the Image property the code will look like this: "Player.Image := PlayerGfx.Items[0];".
As far as I know "Player.SpriteImage.LoadFromGraphic" is used for drawing Delphi specific Graphics like TBitmap. And yes those need to be loaded into graphical memory while all images from DXImage list should be loaded into Graphical memory on application start. I might be wrong on this. Please check the uniDelphiX documentation.


Quote Originally Posted by Proph3t View Post
Then by using that method, how will I load the correct images once the player's frame has changed? This seems like it could work, I just need to figure out how to put it all together.
If my memory serves me corectly you use special Image for animation sprites (it combines all animation sprites in one image formed in horizontal line). Again please check the uniDelphiX documentation on this.


Quote Originally Posted by Proph3t View Post
You use the Image property to specify where the player's Image is (In which DXImagelist I mean). Then by using the AnimCount property you specify the maximum frames for the player. With AnimStart you set the number for the corresponding start frame. By doing this it will load the images from the start point that you specified with AnimStart and keep loading untill it has reached AnimCount's value, then it will loop and repeat the process. Is this correct? AnimSpeed, AnimPos and AnimLooped is self-explanatory I believe.
I belive you are correct but to be sure I still recomend you check the UniDelphiX documentation.


Quote Originally Posted by Proph3t View Post
Then two more things. The ChangeFrame procedure. What did you mean when you said it still changes frames when the player frames havn't changed? Cause "Player.ChangeFrame(0)" is only called when the player is walking. When I use "Player.ChangeFrame(1)" it only changes the player's picture to "PlayerGfx.Items[1]", but it doesnt loop animation?
Code for loading graphic is outside of the if clause that you use to check whether the players picture needs to be updated.


Quote Originally Posted by Proph3t View Post
And how will the "DXDraw1.Surface.Draw" procedure look? Cause it requires "SrcRect: TRect" and "Source: TDirectDrawSurface", which the "Player.Image" property doesnt have
I'm not sure. Will have to check it out more thouraly myself.