Android UI elements in unity - c#

I'm designing an AR andorid application with Vufoira and Unity.Then; I want to add components like side bars in the camera view(Vuforia Scenes). But since I'm new on unity i don't know how to achieve since UI elements in Unity are pretty tough for me.
I bought this component to design easier my App views and also has build-ed views which you can modify quickly.Even though, Adding side bars on the camera views seems to be hard.
UI builder
Any advice,tutorials you can give me on programming android events for achieving side Bar effects in Unity i'd be great.

There is no way to use Android or iOS UI element directly in an Unity game/project. Unity has his own GUI abstraction, so you don't have worry about the code for a button in Android, iOS or PC game.
GUI in Unity (since Unity 5) are basically images that simulates buttons, bars, menus, etc... so, you can create beautiful ui if you have nice design skills.
If you wanna use Android style gui elements you must create every image that represent that component and you must create the code to achieve the behavior desired (so, this could be hard to complex android gui component like tabLayout o NavigationDrawer).
I found a project from a person who wants use iOS gui elements in unity, so he created the images and code for each component, still in beta but works nice for me:
https://forum.unity3d.com/threads/released-ios-for-unity-ui-ios-user-interface-design-for-unity.282399/

Related

How can I render .obj model in Xamarin.Forms?

I have a .obj file that has a 3D body in it and I want to render it in a Xamarin.Forms app that already exists(made with MvvmCross), so I just want to create a new ContentPage that has the rendered body. The user should be able to view the body from different perspectives and maybe click on it to highlight some parts, but that's it.
I found out about UrhoSharp and I also know that I can use Metal and Vulkan bindings for Xamarin, but as I'm a beginner in 3D apps I don't know which one would be best for my scenario, that's why I would like someone to point me in the right direction for this scenario. For UrhoSharp I found this loader which only works on Windows 10, the Android app doesn't load anything and the iOS app renders the body but I can't move the camera around it.
Xamarin forms is good for making apps that are like "Forms" in which you fill out some information and submit.
The best way to do more 3D work is using Xamarin Native, Unity or if you want it to be a small part of your Xamarin Forms app, you can simply create a Custom 3D Renderer in Xamarin Forms.
The beauty of Xamarin is that you can access all the native APIs, so you would just follow tutorials on using the native APIs to access those OBJ files. For iOS, you would just be looking for a tutorial on how to use ARKit and then make small tweaks to add the obj file like this.
Do the same thing for android!

Is it possible to spawn an own Windows10 window inside the Unity HoloLens applications realworld

I am trying to create a Unity Program for HoloLens. I am used to spawn a 3D window inside the projected world. Is it possible to spawn windows like the "Settings" window from the HoloLens Windows10 inside my application?
Or is it possible to spawn another program inside the app?
Or what would be the best way to spawn a 3D window which contains UI-elements like ScrollViews, Text, Buttons and Images?
1) You can't use the code/design of those windows directly in your app, but you can make your own to look similar. Here's an older example of a hololens UI that has been made to look similar to the system ones.
2) It is not currently possible to spawn another program inside a UWP app, sorry.
3) The best (and easiest to learn) way is using the built in UI classes that Unity provides. After following those tutorials, making it work in hololens will be straightforward.

Custom UI control for Android and IOS using C#

I've just started looking at how I can generate and port applications to Android and IOS, I've started to look at Xamarin. First, I'm looking to generate custom UI control of a 10x10 Matrix (checkerboard - each square is a different colour) with each square being able to be selected and a specific image being displayed.
After looking at the documents and looking at MVVM examples, I'm not entirely sure what the best method of doing this : How should I structure the code (should I use just SVG drawing) or is there a better method of doing this in Android and IOS ?
To be honest I would start with Xamarin Forms and create a grid control with 10x10 image buttons. This way you get the event handling built-in. This would work for iOS, Android & Windows Phone out of the box. From there you could evolve it to more native specific code if necessary.
If you want to control the look pixel perfect then creating native custom rendered views would be the option but this is much more work of course so I would not start there. On Android you would subclass from Android.Widget.View and on iOS you would do it from MonoTouch.UIKit.UIView. For both you would override the Draw method.

XNA and WinForms

I was wondering If there was a way to have an xna game within a windows forms or in vice versa. I have found several examples online, but I couldn't understand what they were doing. I was also wondering if there was a way to make a sprite act like a button on a winforms...is it possible to click on a sprite?
Yes, on all.
Sprite act like a button on winforms:
use the onclick event
Xna Game within Windows Forms:
You would need to add a reference to the Xna.framework.something ... sorry kinda out of touch which class implements it but a lot of examples on the xna forums by the community
It should generate a toolbox control to be able to drag and drop.
Example: Nick Gravelyn's Tile Editor... it's youtube based which take you through it step by step.
Winforms into Xna Game:
I would say not to rely on adding a winform objects to xna games as it would not always work. e.g: running on xbox360 :D
Though, it would be same thing as above for the answer.
Examples: Winforms components into xna

C# - Winforms - Animated Slideshow

Well i am developing an application whose interface requires an animated slide show
and by animated slide show i means UI components placed together change their positions after regular intervals in a sliding (animated) fashion. Let me illustrate my idea with the following image,
(source: deviantart.com)
in the image above there are three columns of UI components that i want to slide, what i could do is simply write a module to change x,y coordinates of the components that would give the animated slide effect but that does not work fine, because it is heave takes time in processing and all plus the coding will be complex and layer adjustment and all.
is there any slide show component on which instead of image i can place UI components
What are the other options i have or what is the right way to do it. Please need help.
Sounds like are looking for a carousel feature for you component. Winforms were not intended to be animated. Fortunately some companies have worked on products that support animaiton in this area but most are moving to the Silverlight and WPF platforms for those updated features. As a reader of MSDN Magazine I often come accross some interesting advertisements of Winform components that are quite interesting. Please take a look at this link. The cost of the product is quite high.
Telerik Sample Applications using Carousel feature in Win Forms
Also check out the following link to MSDN. It explains how you can reference the silverlight component as a COM object.
Using Silverlight in a Windows based application using COM
In this scenerio it could also be possible to embed a flash player with a flash animation, using one of the many (commercial and free) xml-based slideshows avaible for flash. This one for example http://www.flshow.net/.

Categories