[Kde-games-devel] Palapeli preview window survey

Ian Wadham iandw.au at gmail.com
Sun Aug 15 02:24:48 CEST 2010


On Saturday 14 August 2010 7:26:43 pm Johannes Loehnert wrote:
> so here is the solution I came up with originally.
> <snip>
> I'm curious about your opinions. :-)
> 
Sounds and looks good!  But I have been sleeping and have not
yet had time to try it (it's 9am Sunday here).

Yesterday I was playing with another new class for palapeli/src/engine:
Palapeli::MagnifiedView.  It's a small QGraphicsView that displays a
section of the puzzle table's QGraphicsScene, about the area of one
piece, in a magnified view - roughly the same size as a piece in the
real world.  The aim is to assist searching for (and inspecting in
detail) a piece in a puzzle that has a large number of pieces.

The magnification widget is working, but I need to work out how to
scale it accurately and move it.  If I have time to finish it today, I'll
send in the patch.  Otherwise it will have to wait till next weekend.
I have a full calendar for the next few days.

Looking at the code for palapeli/src/engine/scene.*, I had an idea
of how to implement, in a fairly simple fashion, sorting-boxes for
large-puzzle enthusiasts, i.e. easy to use, not much coding and in
the spirit of QGraphicsView (one scene, multiple views).

In the present code, if you select multiple pieces and move them
to the edge of the board, the puzzle-table automatically makes
room for them.  My idea is to have a special "drop" action that
works as follows:

  1. Use a generalized version of the code in Palapeli::Scene::
      loadPiecePositions to arrange the selected pieces into a grid.
  2. Make room for the grid (not the scattered pieces), as necessary.
      Maybe allow some extra space for later additions to the grid.
  3. Drop the pieces, as arranged in the grid.
  4. Place a QGraphicsView over the grid area that contains just
      that area and no other pieces.
  5. Magnify the grid and expand the widget on hover, to allow
      easy viewing/selection of pieces to be moved back into the general
      puzzle area.  Not sure yet how the player would signal "done" when
      ready to shrink the box and see the main puzzle area again.
  6. Provide functions to dismiss the widget, etc.  Dismissing
      would send the puzzle-table back to normal, just as if you
      had used the edge to sort those pieces.
  7. Allow steps 1-6 to be repeated with any number of boxes,
      according to the whims of the puzzle-player, e.g. boxes
      for edge pieces, sky pieces, tree pieces, road pieces, etc.

What do you think, Johannes?  I believe it could be implemented
in one fairly small engine-class and, together with a preview and a
magnifier, would go a long way towards making Palapeli a goer for
really large puzzles.

BTW, shouldn't the "preview" be called a "retro-view" ... :-)
It's what you had before you shuffled the puzzle ... :-)  I'm joking, but
maybe "solution" and "view solution" would be good words for the UI.

All the best, Ian W.




More information about the kde-games-devel mailing list