Part II – Using the Mouse to Scroll A Hexagonal Tile Map

Author’s Note:

This piece is directed at the XNA\Monogame engine. However, it will relate to any game engine that incorporates similar concepts and API’s.

When researching how to scroll a tiled map, I have come across many postings on the Internet by other developers with the same questions. For the most part (and I was also) most are interested in how to use standardized scroll-bars for such a process. This seems like a logical interest since most developers embarking on game development have already developed applications where scroll-bars are just part of the implementation of the controls they are using for their applications. However, developers new to game development, are often finding that such luxuries that are common in general and business applications are not so in game development environments. This is because game development is at a somewhat lower level than most other applications leaving game developers without many easy options to implement scroll-bars.

For game development, research has shown that one must create the scroll-bars on their own or get a user-interface toolkit that supports them. So far, for the Monogame engine, I haven’t found many such toolkits that would support implementing scroll-bars with the possible exception of EmptyKeys.

EmptyKeys is probably the most advanced toolkit of its type available for game developers as it provides a near complete UI implementation for game interfaces that rivals similar implementations in the major software vendor IDEs such as Visual Studio and NetBeans. However, due to the nature of its lower level implementation it can be rather complex to learn and work with.

For my own purposes, I have currently settled on the use of the Myra UI, which is appears to be rapidly gaining a following in the Monogame Community due to its easier implementation and highly responsive author. Unfortunately, at this time, the Myra UI does not provide a scroll-bar implementation. However, I imagine if enough developers request it, the developer may decide to add it to the library.

Read more of this post

%d bloggers like this: