Note that I just made another batch of optimizations to our Tiled rendering, Big improvements and optimizations for Tiled maps handling in TCastleScene – Castle Game Engine . I encourage to try it out. And please report more exactly – testcases you make, plans you have, lacks in current API. Then I can address it better We’re not perfect, but I need a better description of the issues you have with current solution (ideally, a reproducible test program) to fix them
As for drawing yourself: See:
-
Custom drawn 2D controls: player HUD | Manual | Castle Game Engine ,
-
How to render 2D games with images and sprites | Manual | Castle Game Engine .
-
And API docs of TDrawableImage: Castle Game Engine: CastleGLImages: Class TDrawableImage .
Drawing using TDrawableImage is relatively trivial, it is really just loading and drawing a simple 2D image. You draw by overriding TCastleUserInterface.Render
or TCastleUserInterface.RenderOverChildren
methods and placing there various calls to draw things. This means:
-
You can do this in a view (see Managing Views | Manual | Castle Game Engine about views), view has
Render
andRenderOverChildren
methods you can override. -
You can make a custom
TCastleUserInterface
descendant like Custom drawn 2D controls: player HUD | Manual | Castle Game Engine shows, draw there. Then from code add this customTCastleUserInterface
descendant to your view.
That aren’t that many examples of using TDrawableImage
because, as CGE high-level API gets more capable, the valid use-cases for TDrawableImage
are more and more seldom Whether you want to draw images in UI, or in viewport, 2D or 3D, or sprite sheets… all these cases are covered by better approaches now, and these new approaches also allow to design stuff in CGE editor. So
TDrawableImage
remains now mostly for “really special purposes when you have a valid reason to implement rendering using images yourself”.