Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: which GUI toolkit for this task?

by zentara (Archbishop)
on Sep 20, 2018 at 15:49 UTC ( #1222730=note: print w/replies, xml ) Need Help??

in reply to which GUI toolkit for this task?

Hi, there are a few good options which I might suggest. I can't claim they are all cross-platform, but they should be with a bit of effort installing libraires.

First, for the best graphics toolkit, with access to sounds and fast graphics, SDL is your best bet. The drawback I find with SDL is that it is not really a true Canvas, with persistence of items, making you handle updating the screen a bit more difficult. See Re: Tk Game Sound demo-with SDL for how to handle SDL sounds from Tk.

If you want to work on Perl/Tk, it can manually do animations and rotations, see Tk::RotCanvas. Tk's main drawback is no transparencies. See ztk-slots for a slot machine. If you use the Tk::Zinc you get a powerful graphics engine with transparencies, rotations, zoom, matrix operations, etc. The problem with Zinc, is although it still works, it is no longer actively maintained, but it has a great manual. See Strangely addictive Tk::Zinc based game for a great Zinc example, and check out the zinc-demo.

If you want something modern and active, I would move up to Gtk2 or 3 and use the Goo::Canvas. It has about all the power of Zinc, but it is maintained and fits well with Perl. Just install Goo and check out the demo, you will see all the possibilities.

Finally, don't forget that you can run something like Goo and SDL simultaneously. One event-loop, say Goo's, is the master loop, and SDL becomes a slave event-loop which gets pumped by a Goo timer. That way you can have the ease of a Goo Canvas for graphics, and the ease of SDL for sound.

Good luck.

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re^2: which GUI toolkit for this task?
by swl (Curate) on Sep 21, 2018 at 03:22 UTC

    Gtk installation on Windows can be a pain, but fortunately syphilis provides PPMs at The set of PPMs does not currently include Goo::Canvas (or GooCanvas2), but one could always ask. They do include Gnome2::Canvas, which has been deprecated for a little more than a decade but still works.

    On that front, and diverging a little from the main purpose of the thread, has anyone succeeded in compiling GooCanvas2? I tried recently, but could not find the typelibs and/or the GIR file that are needed for compilation. Presumably I was just looking in the wrong places.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1222730]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-07-12 03:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found