This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Beginner questions

Tags: None
(comma "," separated)
amadeush
Registered Member
Posts
3
Karma
0

Beginner questions

Tue Nov 20, 2012 7:26 am
Hello marble-devs!

I'm in a small team developing a (hobby) game where we need to display a world globe. Marble is a little (OK, a lot) more advanced than we need - but I think it looks great, and seems to be fairly easy to use. I compiled it for Windows (QT) and linked to it in our C++ project, and it already looks nice! ^-^

I want to investigate a few points that you hopefully can help me with (as a newbie at Marble).

-> I want to have next to no "Marble functionality" left on the map. I've created a new map that only shows the globe (with no data/landmarks etc). Now I also want to get rid of the menu that displays when you left click for a while (co-ordinates appear and you can select to copy them or display their details). Furthermore I would like to override the right click menu (add Measure Point, etc) with my own functionality - how would I do that?
-> My MarbleWidget is looking for map data in my appData folder (.marble). I would like to redirect it to look at our own folder where we store the rest of the game data. How can I do that?
-> Is it possible to set the maximum zoom so that you cannot zoom too close to the map? We plan to just use one map skin, and it looks pixely when you get too close. On a similar note - can I also set the minimum zoom, so you won't get too far away, also?
-> Is there any examples on how to draw a point on the map (for example a city) and catching an event when the user clicks on it to display something?

I hope this is the right place for these questions. 8)
Thank you in advance for your time, and for this awesome project!

Cheers,
Amadeus
ngillotte
Registered Member
Posts
4
Karma
0

Re: Beginner questions

Tue Dec 11, 2012 6:53 pm
The first thing I would suggest is checking out these tutorials. They are pretty handy for understanding various aspects of Marble, and they are quick to compile and get running.
http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

The documentation is also helpful.
http://api.kde.org/4.x-api/kdeedu-apidocs/marble/html/index.html

That being said, the MarbleWidgetInputHandler class is what you want to manipulate to control how input (like mouse clicks) are handled.

Code: Select all
MarbleWidget *mapWidget = new MarbleWidget();
mapWidget->inputHandler()->setMouseButtonPopupEnabled(Qt::RightButton,false);
mapWidget->inputHandler()->setMouseButtonPopupEnabled(Qt::LeftButton,false);
amadeush
Registered Member
Posts
3
Karma
0

Re: Beginner questions

Thu Dec 13, 2012 1:40 pm
Hello,

Thanks (especially for the API link - for some reason I hadn't found it!)!
I think I can work out how to draw and click on the map from that and the examples.

The code you provided works perfectly. I could disable the Marble functionality on left and right clicks.
I also found out how to set the maximum and minimum zoom. In the map data file there's two attributes you can change - so simple!

This leaves me with only one question left unanswered:
-- My MarbleWidget is looking for map data in my appData folder (.marble). I would like to redirect it to look at our own folder where we store the rest of the game data. How can I do that?

You've already been a great help, and I would really appreciate if someone knew the answer. 8)

Thanks a lot, again!
Amadeus


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell