Hi all,<div><br></div><div>I was thinking about how we can add stuff to libkdegames for making</div><div>porting games to QML a little easier and less messier. I came up with</div><div>following ideas:</div><div><br></div>
<div>1. A QML component for rendering and painting sprites from a given</div><div>theme provider. This could be done by reimplementing QDeclarativeItem</div><div>that paints the sprite pixmap which is rendered by a KGameRenderer,</div>
<div>which is instantiated using the given KgThemeProvider.</div><div>(Thoughts/comments required for the name of this QML component)</div><div><br></div><div>2. A KgDeclarativeView, that is essentially a subclass of QDeclarativeView</div>
<div>but adds the kdeclarative sauce on top of it to add KDE's import paths for</div><div>custom QML components (like above), add bindings for i18n, etc. support.</div><div>In addition, this class takes a KgThemeProvider in its constructor, which</div>
<div>is set as a context property in the declarative engine's root context. This</div><div>property is used by the above QML component to get the theme provider</div><div>from the engine and use it to initialize a renderer.</div>
<div><br></div><div>After the above two, a developer would simply add a KgDeclarativeView</div><div>as the central widget of main window (providing it with the desired theme</div><div>provider) and load the source qml files. The qml source can simply import</div>
<div>relevant plugin for using the qml component for showing the sprites.</div><div><br></div><div>I managed to gather up a rough proof of concept code, but needs reviewing</div><div>since I'm not very good at cmake and linking libraries kind of things. Also I</div>
<div>don't know where the above code would go. A separate kgdeclarative library</div><div>inside libkdegames or simply in its root folder? I'll post a review request after</div><div>I'm clear with such doubts.</div>
<div><br></div><div>Thoughts/comments?</div><div><br></div><div>Cheers,</div><div>Viranch</div><div><br></div>