[Kde-games-devel] Theming suport

Matthew Woehlke mw_triad at users.sourceforge.net
Thu Mar 29 02:51:51 CEST 2007


Mark A. Taff wrote:
> On Wednesday 28 March 2007 08:20:37 Matthew Woehlke wrote:
>> Mark A. Taff wrote:
>>> As for backgrounds, I think they should all be svg as well, except when
>>> there are compelling reasons for using a raster image for a particular
>>> background.
>> Sorry to jump in late, but... what is the opinion on tiled raster
>> backgrounds? They also look nice (in a way that's very hard to achieve -
>> at least inexpensively - with svg), and resizing isn't an issue because
>> they tile...
> 
> Not having coded a game myself, but it is my understanding all the SVG's get 
> rendered as raster (pixmap ) ultimately.  The key is that the original 
> artwork be done in SVG, so:
> 
> 1) it can be changed easily and precisely in Inkscape or similar

Raster graphics can of course be changed in e.g. Gimp, Krita, etc, 
although I agree you can't as easily "tinker" as you can with SVG. 
However I don't think this is as important for backgrounds.

> 2) it can be changed programatically, via KGameSvgDocument or similiar

You can certainly filter raster graphics programatically. I'm not sure 
what sort of changes you'd really want to do beyond that. But I'll 
certainly give you that this can be a major advantage of SVG.

> 3) so the tiles can be scaled as required without becoming pixelated
> 
> For #3, let's say the tiled bg normally gets rendered at 25x25px initially.  
> Can it then be scaled to 20x30? to 30x30? to 30x30? Being able to do so is 
> good, imo, but I think consensus around here is that there may be cases where 
> this is impractical, or even non-sensical.  Perhaps your application requires 
> that the aspect ratio be maintained.  That is where the author has to use 
> their best judgement, I think.

This is totally irrelevant for tiled raster graphics :-). Unless it only 
tiles in one direction (in which case an SVG *does* need to be used), a 
tiling raster graphic can be "rendered" at arbitrary resolution. You 
just make enough copies to fill the space and crop any excess.

> What I was speaking of before was a case where perhaps a cityscape of Paris 
> would be an appropriate background, which is nigh impossible to make scalable 
> without pixelation without using fractals.

Agreed. I'm NOT arguing against SVG in any way (and in cases like your 
example, and sprites), I would even argue /for/ SVG, because it /is/ The 
Right Thing To Do. However, I also like some of the current tiling 
raster graphics (WonTon Soup for instance, which I happen to use, both 
directly and in a derivative work, as wallpaper on my other computers). 
Things of this complexity can be difficult to reproduce as SVG and 
achieve the same subtlety (and they also become VERY complicated, large 
(file size), and slow to render when you do).

> If you do use a raster image as a source image, I suggest you at least wrap it 
> inside an SVG document.  That way, your code will permit an artist to update 
> or create a theme that replaces the raster image in the SVG file with an 
> actual SVG-based image.

I would argue that if the code isn't able to let the theme determine 
whether a raster or SVG image is used, it's broken :-). So there would 
be no problem here; the theme would specify if it should use raster or SVG.

-- 
Mathew
(sorry, .sig file is on the other computer)



More information about the kde-games-devel mailing list