Andorra 2D - FAQ
This file contains Frequently Asked Questions about Andorra 2D. If you've got any suggestion or idea, what I could add to this file, feel free to contact me.Installation/Update
Question:I want to use Andorra 2D, but I don't get it installed. The compiler doesn't find AdDraw.pas or other files.
Answer:
Be sure that you added the path to Andorra's "src" folder to Delphi's library path. If you don't know how to do this (it depends on your version of Delphi, so I can't give a detailed description), just copy the files to the "lib" path of your Delphi installation, and not the whole folder. If you have multiple versions of Delphi installed, check whether you copied the files into the correct folder.
Question:
I can't compile the GUI-Editor and the Particle Editor.
Answer:
You have to install the JVCL. Those editors use the "TJvInspector" component. It is created while runtime so that you can compile those editors if you only have "Turbo Delphi Explorer".
Question:
I want to use the GUI but even I copied the use of the GUI-System from the GUI-Editor demo, I don't get it run. I always get an access violation exception.
Answer:
Did you add the unit "AdComponents" to your application? The components have to register themselves to the GUI-System when they are added to the uses clausel. It's the same with "AdPNG".
Question:
When do I need the prerequisites?
Answer:
Normally you don't need them (although they are called "pre"requisites). You need them if you...
...want to use PNG, but you don't have PNGDelphi (http://pngdelphi.sf.net/) installed.
...want to compile the DLLs, but you don't have the headers of the desired graphics system installed.
You don't have to install (what means adding them to Delphi's library path) all prerequisites at once.
Question:
How do I get Andorra 2D run with Lazarus?
Answer:
Andorra 2D natively runs with Lazarus/FreePascal. There is not much you have to do - atually it is as easy as getting it run with Delphi. But keep in mind, that you have to recompile the graphic plugin libraries.
Question:
How do I get Andorra 2D run under Linux?
Answer:
Get it run with Lazarus.
Question:
Andorra 2D doesn't initialize.
Answer:
1. Andorra 2D uses hardware acceleration. So you'll need a true 3D-graphics-card. Also be sure of you have the newest version of DirectX installed, if you use the DirectX plugin. Update your 3D driver. Try to use another plugin.
2. The version of Delphi you use is incompatible to the version of Delphi the plugin dll was compiled with. You have to compile the plugins manualy.
Question:
After updating Andorra 2D, my application stops with an access violation.
Answer:
Probably you forgot updating the graphic plugin DLLs.
Question:
After updating to a newer version of Andorra 2D, I only get a black screen
Answer:
Probably you forgot to replace/recompile the plugin DLLs.
Usage/Misc
Question:There are many DLLs in the binary directory of the Andorra 2D package. Which DLLs do I have to ship with my application?
Answer:
You only have to ship the "AndorraDX93D.dll" and/or the "AndorraOGL.dll". If you use DirectX 9, you have to include the DirectX redistributable in you project.
All other libraries are optional!
If you want to use Cg Shaders you also have to use "AndorraDX9cg.dll"/"AndorraOGLcg.dll" plus the Cg-Redistributable files.
Question:
I want to use PNG files with Andorra 2D, but it doesn't work. How can I solve this Problem?
Answer:
Simply add the unit "AdPNG" to the uses list of your program. Andorra 2D will automatically register the PNG-loader at startup. You have to add the PNGDelphi Component Suite to the library path.
Question:
I only want to use a part of my form as display. Setting AdDraw.Display.Width/Height didn't work.
Answer:
Display.Width/Height is used in the fullscreen mode. Simply add a panel on your form with the desired height/width and set this as parent in TAdDraw.Create.
Question:
I want to draw one picture on multiple AdDraws, but it didn't work.
Answer:
At this moment, this is impossible. If you want to do something like splitscreen for your game, you may limit the display area by setting the AdDraw.AdAppl.Viewport property or use the TSpriteEngineEx from the unit "AdSpriteEngineEx". You may also use multiple surfaces.
Question:
Why is the CPU workload 100%?
Answer:
It's not a bug in Andorra 2D, it's just the way you use the OnIdle function. There are multiple solutions:
1. Simply add a "Sleep(1);" to the end of the Idle function
2. If don't have to update the display again and again (e.g. in editors), don't set "Done" to false.
3. Use the VCL timer
4. Use a multimedia timer
5. Use a thread with the lowest priority (what actually is nearly the same as "OnIdle")
Question:
The textures I load in my program need more graphic memory than they should and my application slows down.
Answer:
Drawing problems
Question:The canvas doesn't draw anything or does weired things.
Answer:
Probably you forgot to call the "Release" function. Call the "Release" function after each draw block.
Question:
I'm displaying an image using patterns (e.g. for animations) - strangely there is a pixel too much displayed.
Answer:
This problem may occur in connection with anti-aliasing and only some graphic-boards. To prevent it, add an one pixel wide, transparent gap between the pictures of your animation and set SkipWidth/SkipHeight of the image to 1.
Question:
It seems like the background isn't cleared although I call AdDraw.ClearSurface - there are "streaks" building up.
Answer:
Probably you created AdDraw in "FormShow". Create and initialize it in "FormCreate". (Problem should only occur with DirectX)
Spriteengine
Question:Using TBackgroundSprite, I get black "gaps" between the tiles. Why that?
Answer:
TBackgroundSprite lets the graphic board do the tiling. The gap results, because Andorra 2D scales all textures up to power of two textures. As an solution, scale the texture to power of two and wait for a newer version of Andorra 2D. This "bug" will be fixed.
Question:
My sprites don't collide - "DoCollision" is not called.
Answer:
Probably you forgot to call the "Collision" method in "DoMove".
Copyright
(c) by Andreas Stöckel 2008
The content of this file is released under the GNU Free Documentation License.