[Kde-games-devel] Chess game for KDE4
Mauricio Piacentini
piacentini at kde.org
Sat Dec 5 00:42:47 CET 2009
On Fri, Dec 4, 2009 at 8:57 PM, Parker Coates <parker.coates at gmail.com> wrote:
> If you're talking about having a sceneRect that's a different size
> than the QGraphicsView widget, yes, you can do that, but the result
> doesn't look very good. You lose pixel perfection.
>
and
>
> Despite it seeming attractive, you really don't want to use
> QGraphicsSvgItem. Rendering SVG is expensive and you're going to want
> full control of when and how that happens. Almost all the QGV based
> games use QGraphicsPixmapItems that get their pixmaps from a renderer
> class that uses QSvgRenderer and KPixmapCache internally.
Both of these combined, imho, are the reason why KGameCanvas is still
a very good solution for some games, as it already uses pixmaps
(pre-rendered from SVGs) and the scene rect matches the view size. So
you get speed, control and pixel perfect alignment, not to mention the
ability to actually get into the scenegraph code and solve any bugs
directly without waiting for a new release. Sometimes less is more.
In other times, QGV seems to be a good general purpose solution, and
we have several games using it successfully. But check the code for
the existing games in the module first if you are going to use it, to
avoid repeating the mistakes others have already done before you :)
Regards,
Mauricio Piacentini
More information about the kde-games-devel
mailing list