Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

which GUI toolkit for this task?

by albert925 (Novice)
on Sep 20, 2018 at 05:26 UTC ( [id://1222692]=perlquestion: print w/replies, xml ) Need Help??

albert925 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am looking for a cross-platform GUI toolkit for Perl that can have animatable 2D textures & buttons (animatable position / rotation) , some thing that can work well with card games and board games and look nice.

Using Perl/TK at the moment but I don't think it is best suited for this task. Any suggestions are welcome. Thanks

Replies are listed 'Best First'.
Re: which GUI toolkit for this task?
by kevbot (Vicar) on Sep 20, 2018 at 06:21 UTC
Re: which GUI toolkit for this task?
by zentara (Archbishop) on Sep 20, 2018 at 15:49 UTC
    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

      Gtk installation on Windows can be a pain, but fortunately syphilis provides PPMs at http://sisyphusion.tk/ppmindex.html. 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.

Re: which GUI toolkit for this task?
by rizzo (Curate) on Sep 21, 2018 at 00:06 UTC
Re: which GUI toolkit for this task?
by albert925 (Novice) on Sep 23, 2018 at 03:14 UTC
    thank you for the answers, it is helpful.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1222692]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-28 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found