[Kde-games-devel] KNetWalk

Mauricio Piacentini mauricio at tabuleiro.com
Sat Oct 6 15:46:36 CEST 2007


Fela Winkelmolen wrote:
> About the background stretching issue I was thinking about having two 
> background images one that stretches over the whole area and one (called for 
> example BackgroundOverlay) that keeps it's aspect ratio, kinda what I did 
> with KBreakout but it would be also usefull for pictures that need to keep 
> their ratio to look nice, which, if I understand you correctly, is what you 
> want to solve. This would avoid having empty borders that may not look so 
> nice.

When we discussed this option in the KDE Games BoF session in Akademy I 
gave the same suggestion: two layers of background, one stretching 
(could even be a single color or patter), and the other fixed, with 
transparency, etc. I also feel that this can be better than cropping for 
some games. It is nice to see that you added it to KNetwalk, I agree 
that in this case it is really a better solution compared to cropping 
the bg.

> If you want to add KGameTheme support to KNetWalk go ahead, but I also don't 
> mind doing it myself, I'll have to add it to KBreakout at some point anyway 
> (Eugene already made a great theme for it! =)

I suggest having a look at the excellent renderer.cpp and renderer.h 
classes implemented by Dimsuz in KMines. They already integrate with 
KGameTheme in the simplest possible way, and handle rendering of game 
elements in a single class for the whole app, much like you are doing 
with the static KSvgRenderer in KNetwalk (minus the bg.) Also, the 
KMines implementation already has pixmap caching, something you do not 
have in KNetwalk, and might be hurting performance a bit on slower systems.

Great job!
Mauricio Piacentini


More information about the kde-games-devel mailing list