[kde-edu]: Custom Turtle / Re: Kturtle

Mauricio Piacentini piacentini at kde.org
Thu May 28 17:07:22 CEST 2009


On Thu, May 28, 2009 at 11:52 AM, Niels Slot <nielsslot at gmail.com> wrote:
>> There was a proposal to add multiple sprites and the ability to change
>> the sprite visual. I believe it is not that difficult code-wise, and
>> Niels have laid the groundwork for it already. It is just that not
>> much happened between 4.2 and 4.3 (our fault)...
>
> Not sure which groundwork you're referring to. I did some work on allowing
> multiple turtles to exist, but that wasn't directly related to different
> sprites. Starting with the KTurtle version in KDE 4.0, it hasn't been hard
> to change the sprite file, since KTurtle uses SVG.

Yes, I was referring to the multiple sprite work. Changing the graphic
is really simple compared to it. Of course, there is the issue of how
to package...

> I think we should ultimately try to have some sort of packaged option. I
> hope we can reuse some of the code used in Plasma for their packages. A
> KTurtle program would then consist of the script, and all the SVG files and
> other resources (sounds, backgrounds anyone?) required by the program.
>
> This approach should also work great in combination with GHNS as Anne-Marie
> suggested in another mail. We could maybe also use GHNS for these SVG files
> themselves. This way a user would be able to use GHNS to make his KTurtle
> program look nicer by just clicking on the 'Download more sprites' button.

Looks interesting. But maybe it is too complex? Not sure, if it can be
made simple to the user and complex for us I am ok with it.


>> settheme "myfile.svg"
>
> Putting a filename in a KTurtle command seems wrong to me. I think it would
> be better to change the sprite by a more human name. Ideally this would be a
> translated name for the sprite or theme. For example, in the English version
> a 'settheme "hedgehog"' command would be possible. The Dutch version would
> have the command 'zetthema "egel"' ('egel' being the Dutch word for
> hedgehog).

Have a look on how we do in the games, using the svg ids to identify
the elements. We could use a translated name for the theme, for
example

settheme "Egyptian"

For this to work you will have an egyptian.desktop metadescription of
the theme, and this would be translated automatically by the existing
infrastructure in KDE. In this .desktop file you could also list the
element names. It would look like:

Name=Egyptian
Turtle=Turtle
Propertyn=avalue
....

Scripty takes care of extracting these and exposing it to translators,
and they are regenerated from the .po files. So eventually it turns
into:

Name=Egyptian
Name[pt_BR}=Egípcio
Name[nl]=xxx

All you have to do in KTurtle is to get the localized string for the
Name key, and it will automatically work.

Notice that I would also add the ability to setsprite, not only
settheme. So it could be:

settheme "Egyptian"
setsprite 1, "Pharaoh"
setsprite 2, "Crocodile"
setbackground "Sand"
... and make them run into each other :)

Niels, I remember we discussed multiple sprites last year, but do not
remember the conclusion. I have a vague recollection of Cies not being
too enthusiastic about it, but not opposing it as well. Do you
remember this?

Regards,
Mauricio Piacentini


More information about the kde-edu mailing list