[Kde-games-devel] Theming support
Nicolas Roffet
nicolas-kde at roffet.com
Sat Mar 17 12:04:26 CET 2007
Le samedi 17 mars 2007 02:12, Mark A. Taff a écrit :
> I have subclassed QDomDocument, so now elementByID now actually returns a
> node. This should probably become KGameSvgDocument of some such. I also
> have functions for transforming the fill color and opacity style attributes
> (can be generalized to all style attributes). I *almost* have a similar
> function to apply matrices.
>
> In the end, we can do just about everything we need to:
> recolor,
> skew,
> scale,
> rotate,
> reposition,
> ???
>
> This is all done by manipulating the DOM in memeory, with pixmaps cached
> (not yet implemented) for speed.
I coded also something close to this.
In KBlackBox, I'm drawing "laser rays" as normal QGraphicsPathItem (no SVG
items). But I'm reading the attributes of the laser rays in the SVG file with
a simple DOM XML parser. So the artists can draw and customise the laser rays
directly in the SVG file (with their own drawing tool like Inkscape) like
they do for all other *real* SVG items of the game.
:)
(If you want to have a look at it:
http://websvn.kde.org/*checkout*/trunk/KDE/kdegames/kblackbox/kbbscalablegraphicwidgetnonsvgitems.h
http://websvn.kde.org/*checkout*/trunk/KDE/kdegames/kblackbox/kbbscalablegraphicwidgetnonsvgitems.cpp
)
Merging everything in a future standard KGameSvgDocument class could make
sense!...
--
Nicolas
More information about the kde-games-devel
mailing list