I’m in the process of making a game and the aim is to target mobile devices (Android and IOS). I’ve developed for Android before, but I used pure Java with Android Studio. Right now in my MonoGame project, I’ve designed my game menus from scratch, and created my own lists, sliders, and other interactive elements which I render using SpriteBatch.
Is this the right way to do it? Should I assume I won’t be using any menu systems native to each platform, and just implement them all myself? Or is if standard to try and use platform-specific elements (like ListViews, Sliders, text boxes, etc)?
I suppose it’d depend on your game and what it does.
But if you design the UI yourself, it’s independent of any platform. So if you’re worried about platform independence with regards to the GUI, making your own gui is the most independence you could have, really. Your gui only relies on the Monogame framework, and the Monogame framework is handling the platform-centric dependencies for you. As long as your GUI works with the Monogame framework, your game’s GUI by extension works with every type of device that Monogame supports(excluding some specific edge-cases which may exist).
But of course it is extra work to roll your own GUI and maintain it, so that’s a trade-off you have to decide is worth your time. The most you’ll have to worry about that’s platform specific is designing the end-product in a way that feels comfortable on different devices.Things like, having a virtual keyboard on mobile, if needed. Or making your GUI look/feel like a mobile app in the menus where it’s needed. But those are all things you have control over to develop, if you want.
Another thing to consider is that if you did develop on a platform-specific model with your view class(the visual/gui elements, I’m suggesting MVVM), you now have to learn to code in those other frameworks, and your entire game is now coded around this concept of supporting multiple different UI Frameworks. Having your own GUI means you only need to develop and care about a single framework. Your own. And your GUI framework can be designed to work on other platforms however you like.
Personally, I rolled my own GUI because I wanted to learn how to program GUI’s, so there’s that. There’s a few good GUI libraries out there as well, like Myra or GeonBit, etc. If your menu needs are simple and you don’t care about the learning experience, maybe just use one of those. Since they are built on the Monogame framework, they too will work across multiple devices. I know Myra has some touch support for mobile, for instance.
Thanks for the reply! I can see what you mean - personally I don’t know anything about IOS menus (or IOS apps in general!) and I do quite like the menu system I’ve come up with. I have total control over how the layout responds to screen size and exactly what each item does.
Plus my menus are going to be simple - the most complex one so far is just a few sliders and a little mini-map with interactive elements. Come to think of it, I’m not even sure how I’d implement that on Android, so yeah I’ll stick with my system for now!