Language / graphics library for creating a map editor

I am developing a cross-platform graphical editor for the application that I developed, and I'm not sure which approach should be taken with regard to the choice of language / gui library. For some basic information, the editor should parse and output the xml files.

I like C ++, Lua and Perl the most, but I would also like to use Python (can use this practice). I would prefer to do this in a scripting language to improve performance.

Any recommendations are welcome, thanks.

I also need support to fill out forms, etc.

PS I tested the extension of existing map editors, but it's really not worth it, because they do not provide the functionality that I need at a fundamental level, requiring me to simply rewrite all of this anyway.

+7
c ++ python user-interface lua perl
source share
3 answers

I can recommend using Python and PyQt for the job. Qt offers a class for controlling the scene (for example, multi-level placement of objects, scaling, impact testing, events, coordinate transformations, etc., even detecting conflicts) called QGraphicsScene and an appropriate control for displaying all of this, called QGraphicsView. It also offers drag & drop support, which allows you to place interactive objects.

Implementing a map using these classes actually just creates QGraphicItems (Rectangles, Polygons, etc.) and adds them to the scene, Qt does the rest. You can see how all this is suitable for reading documentation, especially the document β€œ Graphical Viewer . ” Recently, I had to implement something similar for the client, and I really liked this approach.

+2
source share

My preference is always Gtk2 and Perl 5, but this combination works best on Linux. What OS are you going to run?

Here is an example of a Perl 5 script using Gtk2:

 #!/usr/bin/perl use strict; use warnings; use Gtk2; Gtk2->init; my $window = Gtk2::Window->new; my $vbox = Gtk2::VBox->new; my $label = Gtk2::Label->new("click the button"); my $button = Gtk2::Button->new("click me"); my $i; $window->signal_connect(destroy => sub { Gtk2->main_quit }); $button->signal_connect(clicked => sub { $label->set_text(++$i) }); $window->add($vbox); $vbox->add($label); $vbox->add($button); $window->show_all; Gtk2->main; 
+4
source share

Based on Lua, I would recommend IUP for GUI. It is lightweight, portable for Linux and Windows, and is well integrated with Lua. For those who love Gtk, IUP includes a driver for Gtk, so you can basically port it to any system where Gtk can port.

Another plausible choice is wxWidgets , which also has a wrapper that integrates it with Lua.

Both IUP and wxWidgets are included in the Lua package for Windows .

+2
source share

All Articles