Development/Tutorials/Games/Palapeli Slicers

From KDE TechBase
Revision as of 16:27, 20 July 2008 by Majewsky (talk | contribs) (abstract and structure paragraphs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Creating a Palapeli pattern
Tutorial Series   Programming with the Palapeli API
Previous   Introduction to KDE4 programming
What's Next   n/a
Further Reading   Palapeli::Pattern, Palapeli::PatternConfiguration
I'm currently creating this tutorial. You should not edit this page in the mean time. -- Majewsky 18:19, 20 July 2008 (CEST)
Warning to editors


Abstract

This tutorial shows you how to create a pattern for Palapeli, that is: a plugin for the Palapeli libraries that describes an algorithm to split an image into pieces.

The pattern we will be constructing is quite easy: It splits an image into two equally sized pieces.

Structure

A pattern plugin consists of two classes. The first one (derived from Palapeli::PatternConfiguration) tells Palapeli what features this pattern plugin has and which configuration values it needs. The second one (derived from Palapeli::Pattern) does the actual slicing.

The code