I trying to write a new game using Libgdx.
Before I jump into creating the main screen (menu) , I wold like to ask a quick question from the experienced developers
What are the pros and cons in writing a menu splash screen in android native code(using activity etc.) vs writing a AbstractScreen using Libgdx scene2d?
I'd generally suggest you to use the Screens completely instead of having a separate activity just for the loading purposes.
Afaik there already is a SplashScreen class you can extend and use. But even besides that, it's fairly easy to create a class for your LoadScreen that implements the Screen interface.
In this class you can have an AssetManager to asynchronously load your assets while displaying e.g. a load bar or just a splash image or animation. Doing this as Screen in libgdx vs. a separate Activity will also give you the full control over the look. You can use your shaders, assets and whatever completely within your libgdx structure, no need to tinker around with connecting the load activity with the rest of the game.
After loading your assets, the menu can also be easily created with libgdx and scene2D. Your menu buttons can use the same skin and look as buttons in the rest of the game, using tables and other layouting options allow you to easily create good-looking menus.
And even though it might not be important to you yet, doing all this completely in libgdx will result in it to work on desktop and iOS as well. You can almost completely test the gameplay and look of your game on the desktop, which is faster than deploying to Android all the time.
Related
I'm building app with one main activity which UI looks like TV remote. I need to show interactive response to the user when he interacts with UI through taps.
UI is created with Illustrator. I was searching for some SVG solutions but only found animation and morph libraries. Turns out I need to reload part of the UI, because reloading everything on every tap seems heavy on performance.
What good solutions there are for this problem? Load SVG in parts and put it together with css? I'm even considering moving to native Android if there's no way, because my app depends on some phone hardware control. By the way, I'll also be moving design to Adobe XD for prototype creation, so maybe there's something to go in line to make life easier.
So here's a way I solved this:
Give names to illustrator layers to be exported (even hidden layers should be shown to be exported)
Export selected artboard as SVG with internal CSS and select 'layer names' for Object IDs
Open SVG in editor and adjust initial styling as needed (gradient, stroke, hide layers to be switched etc).
Use SVGR to convert SVG into React component
Set component position
Pass props to React component to change styling at runtime and interact with user
When using the layout designer in Android Studio, custom classes that I create which extend the View class show up in the layout designer (picture relevant)
Is there a similar way to make custom classes appear that extend the Fragment class?
My use case is that I'm developing a library which I will distribute to our clients. I want it to be as easy as possible for someone to use this library to place a video player in their own application. I discovered that fragments may be exactly what I need -- something which has a defined appearance, can be trivially dropped into someone else's layout, yet is able to manage its own state, perform business logic, and listen to life cycle events (for the sake of cleaning up video buffers, stopping timers, and de-allocating resources)
However when I tried switching from using a View to using a Fragment, it didn't show up in the palette to be dragged and dropped into my app. While not absolutely and incredibly super-duper necessary, I was really hopeful that I could maintain that as an ease-of-use feature.
Im working on building my own game for AirConsole. I am using Unity, have imported all relevant assets and have begun my project.
So basically what I want is two different sprites to show up on the users controller depending on if they have not touched the screen, or have swiped up on the screen and are holding. So far all my research has showed very basic controllers with just buttons. Is this even possible?
Yes that's absolutely possible.
The controllers are written in HTML. Javascript and CSS are supported. So anything you can do in a mobile browser can be done in an AirConsole controller.
This is my first time doing Xamarin Form or PCL. In Xamarin Form, I can see there are few controls and pages available. Can we still able to design android layout in resource folder and called setContentView in onCreate function.
Sure you can - you're fully able to mix-and-match any Xamarin.Classic code within Xamarin.Forms . You'll have to create the Android design inside the .Droid folder and understand that this functionality will only be available on Android.
To make it work, you'll have to create a Custom Renderer. Forms will use this Custom Renderer to embed the Xamarin.Classic code inside the Forms application. I suggest you to read the documentation about this subject, or check out this video.
Take note that - if you're doing this - you're not fully using the power of Xamarin.Forms. Forms is created in such a way it should be easy to create cross-platform apps with loads of re-use. Creating Custom Renderers will make it work for one platform, but not magically for the other. The OnCreate functionality is something is available in the Xamarin.Forms lifecycle as well, which does work cross-platform.
I hope this guides you to the right direction - good luck!
Ok, so I've made one app but know I'm getting all ambitious and want to make a game.
So first I want to start off with a menu. I would rather draw this all myself instead of using the built in classes. So should I then override the button class to change the look or should I use OpenGL or Canvas? Any help?
Before you go too crazy writing your own UI toolkit, have a look at http://developer.android.com/guide/topics/ui/themes.html
Android already has a lot of ways built into the framework to skin your app differently than the default UI.