HOMEBLOGDEVLOG

Select airport UI

Adam C. Clifton
4 Jan 2026

Before we can do things like get airport slots and create routes in AeroCEO, we need to be able to actually select airports. So I've made a few updates to the world input and rendering.

Clicking and dragging will scroll the map around, I've also setup cropping so that off screen airports are not being rendered.

Once the mouse is close enough to an airport, it's name appears in the top corner and it is highlighted on the map.

Most of the input, dragging and cropping code was already part of my game engine. But I had to do some mathing to convert the mouse x and y position on screen into longitude and latitude to compare to the airport positions. It's a little more convoluted to do it that way, but that should also convert nicely if the world is rendered in 3D later.

It's also a simple x+y distance calculation to find the closest airport. That can be made nicer later with a little bit of Pythagoras. Or even nicer again with the Haversine formula.

Previous: 2D world map
Next: Clickable airports
© Numbat Logic Pty Ltd 2014 - 2026