[Kde-games-devel] KMahjongg frameworks branch

Ian Wadham iandw.au at gmail.com
Sat Dec 12 02:08:45 UTC 2015


Hi Frederik,

You must have read my mind…  The SVG file you attached (classic.svg)
is very like one I developed last night…  You even used 70% opacity for
the shadows, same as me… :-)  I found that value made the shadows not
too dark on a background like Light Wood and juuusssttt visible on a very
dark background like Egyptian.

So let's go with those 70% shadows… :-)

On 12/12/2015, at 1:07 AM, Frederik Schwarzer wrote:

> Am Freitag, 11. Dezember 2015, 14:10:11 schrieb Ian Wadham:
>> On 10/12/2015, at 8:02 PM, Frederik Schwarzer wrote:
>> Not sure what you mean by "enter group".  Is it a menu item?  Is it
>> a keyboard shortcut?  Is it a Select option?  I have Inkscape 0.91
>> and all it seems to have is menu items Object->Group and
>> Object->Ungroup regarding groups.
> 
> I have an additional context menu entry sometimes (have not figured out 
> why it is not always there) names "Enter Group". Version is 0.91 as 
> well. You can work on parts of a group without ungroup->...->group.

These links might explain it.  As they say, there are "myriad" ways to
select things…  But you need a Windows/LInux keyboard…  See:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Basics.html
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Select.html

Right-click on any graphics (or other) object brings up an appropriate
context menu for things that can be done with that object.  See how
this applies to "Enter group" in:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Groups.html

>> Looking at the XML of the Classic theme, it looks as though all 8
>> blank tiles in the group just above the tile-face pictures are
>> supposed to be derived from the two blank tiles at the top of the
>> SVG layout.  It also looks as though some of the links have been
>> broken, especially in TILE_1 (which has its shadow at the
>> south-west corner).
> 
> Yes, TILE_1 was the one I was playing around with because its shadow 
> did not change when I changed the shadow of one of the tiles at the 
> top.
> 
>> I also tried menu item Edit->Clone->Show Original (shortcut Shift D)
>> on the group of 8.  Some of them are clones of the top 2. but most
>> are not.  I think they are all supposed to be, but have been broken
>> at some stage.  There is an unfinished theme in libkmahjongg called
>> Bamboo.  It is inspired by the Classic theme and seems to work
>> roughly that way with its blank tiles and clones.  Using Shift D on
>> Bamboo's group of 8 shows that they are in 2 groups of 4.  Each
>> group of 4 has 3 tiles that are clones of the 4th tile.
>> 
>> A clone can be transformed from the original but retain its colour
>> and shape, so my theory is that, in the Classic theme's SVG layout,
>> the unshadowed tile all by itself at the left is originally the
>> "grandfather" of the 8 tiles and the "father" of the 2 tiles at the
>> top, which have had shadows and highlighting added.
> 
> That's what I suspect as well. But so far I cannot see that in the file 
> itself. Maybe we need DNA tests. :)

The following link put me onto how to get a bird's eye view of object
structures in Inkscape, especially if you have readable IDs for objects,
instead of a bunch of computer-generated IDs.  So try it on the version
of "classic.svg" that you sent me… :-)
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/XML-Basic.html

In fact, that was how I found out how to select any sub-object at any level
in a group.  You can click on an object in the drawing to select it and the
XML automatically scrolls to where it is defined in SVG.  Then you can
tree-view the group, by clicking on the little arrows, and click on a sub-item
in the XML to have it selected back in the drawing.  A few tries show up
which sub-group is a shadow-group in "classic.svg".  Then, when it is
selected, you can easily change the properties.  Beats poking at graphics
with mouse and special keys and hoping you find the right hotspot.

So there's your "DNA"… a simple matter of data-structures, Watson… :-)

Now that I know this, I might be able to fix something in the "Treasure of
Egypt" theme of KGoldrunner which has been bothering me for years -
empty strip at bottom of frame… :-)

>> To create a clone, use Edit->Clone->Create Clone, move it to where
>> you want it (it starts on top of the original), then use
>> Object->Flip Horizontal (key H) and/or Object->Flip Vertical (key
>> V) to get the shadows where you want them.
> 
> Just did that (the cloning hint was very helpful) and now Shift+D 
> shows the correct original.
> 
>> I tried renaming TILE_1 to WAS_TILE_1, then creating a clone and
>> calling it TILE_1 and flipping the shadows to the south-west. 
>> Guess what?  The new TILE_1 stayed in good alignment with the
>> tile-faces and with its highlighted counterpart.
> 
> That's great news. Here it now works as well. Do you want to commit 
> your changes? You have more insight into this. I mean, my version 
> works as well, but I still do not see through this. There must be some 
> other kind of linkage between the tiles than cloning. The unselected 
> tile at the top (XML: id="g3381") is using the tile on the outer left 
> (XML: <use xlink:href="#Tile" [...]). ... Ok, now I removed the outer 
> left tile and everything still works. Maybe it was just there during 
> creation of the tiles? ... ... …

I am not sure if it is completely safe to remove that, but I suppose it
must be.  Nothing breaks if it is not there.  Those marginal prototypes
seem to be a commonly-used artists' technique.

> OK, now I removed all tiles except 
> the upper two, ungrouped them (several layers of grouping), named 
> everything (what's #g3372 anyway?), regrouped them and cloned the 8 
> final tiles from it. I attached the file. Please review and comment. 

Excellent, see below.

>> Mind you, I do not think that changing the opacity of the whole tile
>> is the way to go.  It lets the background and the tiles underneath
>> show through.  There must be some way to change just the shadows…
>> ;-)
> 
> Yep. I only changed the shadow by "entering" the group. Apparently 
> cloned cannot be ungrouped so it only worked on TILE_1.

I think TILE_1 got well and truly "un-cloned" at some stage.  See menu item
Edit->Clone->Unlink Clone.

You can "enter" the *Original* group of a clone and then anything you change
in the original also changes in all the clones, as I see you must have found
out already with the shadow opacity of the two original shadowed tiles.

Please commit and push your new "classic.svg" file (to master of libkmahjongg,
I suppose).  Your SVG has the same look as mine, but I like your use of readable
names for the objects, even the names that are not directly used by the KMahjongg
code.  Once the clones are back as they should be, a lot of the little graphics
glitches in "classic.svg" are fixed --- maybe all of them… :-)

Cheers, Ian W.



More information about the kde-games-devel mailing list