There is a TPHXCanvas, which is a little inefficient, but is very canvas-like.
There is a TPHXCanvas, which is a little inefficient, but is very canvas-like.
i meant like a component that you can put on a form. like the TDXDraw, wich can be placed on a form and scaled and whatnot.
Yeah there's one of thoose, but it's in the editor source bundle that i havn't released yet. I'll upload a zip with em (however they are in the state of working, and that's it)
http://phoenixlib.net/files/Util.zip
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
thx! now i just have to find out how to use it...
EDIT: wich i just did...
Hi ..
I just wanted to say thanks for this library.
Its simple, powerfull and chock-full of usefull and easy to use functionality that takes the grind out of delphi 2D games developing but leaves the fun bits in.
When I discovered how easy to use everything was and saw how professional the resource management tools were, I just decided I had to express my support and admiration.
I can't tell you how happy I am that I found this and really hope sincerely that you will keep up the great work.
I will soon be moving my IK+ online project over to phoenix from Delphix
Check out my Delphi programs, music and writing.
<br />http://digitalfunnybone.com/Programming.html
Hmm... does the TAnimatedSprite's Z property do anything?
In my game, a character is a set of different sprites put together. to get this working in UndelphiX, all i had to do, was to adjust the sprites Z-property so that a character standing behind another actually WAS behind it. this does somehow not work in Phoenix2D.
Mind explaining how Z-Buffering works here?
Example:
Body1:= TBody.Create(...);
Body2:= TBody.Create(...);
Body1.Z:= 0;
Body2.Z:= 1;
Body 2 is in front
then i tried
Body1.Z:= 1;
Body2.Z:= 0;
Body2 is still in front.
What is more is that i have to have different parts of a character on different layers, because one layer only takes one image (one layer for bodies, one for suits, one for hair, etc). this also ****s stuff up when to characters walk through eachother, and hair is ALLWAYS printed on top of bodies, unrelative to anything.
This on top of the Z-Buffering problem is giving me a headache.
Why not let EACH sprite have the ability to have its own image? I tried implementing that myself, but couldnt figure out how rendering and such works with openGL, so i gave up...
Pls Help?
Besides this, the engine is brilliant
Well the z-buffering should work by default (unless it's disabled somewhere else) try calling
before rendering the sprites and test if it helps. One thing to note thought, the blending might cause problems if you enable deapth testing, a sprite that is rendered before another sprite cant blend with the following one (this is a limitation of OpenGL and DirectX and has nothing to do with Phoenix). If you only has one color transparency you can avoid this by callingCode:glEnable (GL_DEAPTH_TEST);
and this will skip all transparent pixels further up in the opengl pipeline.Code:glAphaFunct(GL_GREATER, 0.1); glEnable(GL_ALPHA_TEST);
The reason behind the sprite layers (wich was a new adition to the 1.0 release, the betas had one texture per sprite) is simply a speed matter, you can render 10x times the sprites by batching sprites into a larger spriteset instead of needing to rebind the texture for each sprite.
And for a hint on how to render one image per sprite:
Code://------------------------------------------------------------------------------ procedure TMyAnimatedSprite.Render; var Image: TPHXImage; // Move to private decleration begin Image:= ImageList.Find('MyImage'); // move to constructor glPushAtrib(GL_TEXTURE_BIT); // Save the binded texture Image.Bind; glPushMatrix(); glTranslatef(WorldPosition.X, WorldPosition.Y, WorldPosition.Z); glCallList(Image.DisplayList + PatternIndex + 1); glPopMatrix(); glPopAttrib(); end;
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
found this "bug":
[pascal]
procedure TPHXAnimation.Update(State: PPHXAnimationState; FrameTime: Single);
var Frame: TPHXAnimationFrame;
begin
// Only update if active
if( State^.Active) then begin
// Add the time to the state
State^.Time := State^.Time + FrameTime;
// Get the current frame
Frame:=FFrames[State^.Index];
// test if we shall change to the next frame
if( State^.Time > Frame.Time ) then begin
Inc(State^.Index);
// Test if we reached the end of the animation
if( State^.Index = Count) then begin //What if state is larger than count?
[/pascal]
I found the problem when my sprites suddenly stopped worked when changing animation length from 4 to 1. wich would effectively make "State^.Index" larger than "Count".
the solution is obvious...
(and i have just spent an hour and a half trying to figure out what made my sprites disappear when i stopped moving)
Hehe, yeah that was quite dumb tbh, in normal circumstances it would never occur (ie calling reset after editing the animation) but well.
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
Hi
Have any information from next version?
Thx
BigJoe
Bookmarks