I am building a chat application for BlackBerry 4.6.0, and want to create a Contacts screen. This screen will list your active and inactive contacts. In order to do this I am trying to use a ListField, and it's associated ListFieldCallback.
My question is if it is possible to draw normal Ui components (like an VerticalFieldManager, CheckboxField, RadioButtonFields, etc) in each of my list items.
I see that the drawListRow method that should be overridden to draw a list item only provides a Graphics object. If at all possible I would rather not have to draw all the components I want manually using it (would be a major time drain!). Isn't there a way that I could get a fieldManager to use the Graphics object to draw itself with the appropriate x/y and width/height values?
One does not normally add UI objects to a list since if the list has many items the overhead would quickly consume available resources. The application is responsible for rendering the list times in a ListFieldCallback. The ListField, designed this way, can efficiently display all contacts, or all messages even on a device without much memeory.
If your applicatin is to display a small number of items then instead of the ListField use a UI element that extends Manager.
Related
Can someone advise what tools should be used to implement such a task ?
We have a virtual avatar in our application, whose settings allow us to change its equipment / inventory. When you change the equipment in the settings, the new avatar skin is displayed in the application on different screens already with new items (it can be weapons, clothes, shoes and other things). At the moment we use Lottie animations for this, in which we edit json nodes from swift code, but this is too heavy from performance and smoothness point of view
Is there any way to do a similar 3d character editor without using tools like Unity ? I'd like to avoid a long transition between the ios app and the Unity scene load
I know of several apps that, for example, let you edit the colors of objects (like seven, in which you can change the color of the character and his clothes) or their configuration. Is it possible to implement this with SceneKit ?
I'm making a game in MonoGame with several states. It is very complicated to manage all this in the same class. Is there a way to divide these states with different objects and properties between different classes?
I want to manage the same modules: Draw, Update, load content but focused on other states of the game.
If by different states you mean something like different game screens (menus, main game screens, maps) you can create a game screen class which then contains the functionality required for the current state and overrides Draw, Update etc methods. You can create a different game screen for every map or just one map screen which then loads the map externally etc.
Then create a class to manage current game screens which has methods for changing active game screen (creating new instances by activator and setting it as current screen object) and calling the current screens update & draw methods via override. The main game loop will then call the screen manager without having to worry about knowing the current state.
I found this particular tutorial series to be really helpful since it explains on how to create game screens, screen managers etc: https://www.youtube.com/watch?v=agt9-J9RPZ0 (C# Monogame RPG Made Easy Tutorial by CodingMadeEasy).
According to this page, https://docs.unity3d.com/Manual/iphone-basic.html, too many UnityGUI elements is considered bad, but what is too many if my game runs entirely on the canvas? At the moment, my UI will contain about 100 objects, most are buttons and 80 of the objects, use full or portions of 3 textures to display the objects.
Does this mean that uGUI cannot or should not be used for iOS games?
That post is talking about something totally different and you are confusing yourself with uGUI and UnityGUI/IMGUI.
UnityGUI/IMGUI is an old UI System. That's what the article is talking about. Don't use it. I've been warning new users about that too due and they use it due to old tutorials they are following.
The only time you should use this is when you are writing an Editor script to test your game in the Editor but this should never be deployed to your mobile device or used as a standalone build.
How to know when you are using UnityGUI/IMGUI or which tutorials to avoid? When you see OnGUI() anywhere in the code, then stop.
The latest UI System in Unity is simply called uGUI. I don't know if the name has changed but this was the original name when it came out. It is only available from Unity 4.6 and above. You can find this from the UnityEngine.UI; namespace.
This is the link you should be reading for the new UI and here for UI tutorials.
Does this mean that uGUI cannot or should not be used for iOS games?
uGUI should be used for all your UI work.Again, I am not talking about the UI from the article. I am talking about the UI from the UnityEngine.UI; namespace.
my UI will contain about 100 objects, most are buttons and 80 of the
objects
uGUI uses Canvas to drive the UI and they are parent GameObject of UI components.. You may want to separate them into different Canvas. For example, MainMenu Canvas, PauseMenu Canvas, GamePlay Canvas.... Under each Canvas, you can then have your components such as Buttons and Texts.
When you are on the main menu, you enable the MainMenu Canvas and disable the rest. You can do this for your other Canvas in your scene depending on the mode of your game. I can't think of any scenario where you need 80 UI components at the-same time, on the scene. You must separate them.
I'm playing with live tiles on Mango and it's all nice and all. User can delete secondary tiles and everything, but if the user "unpins" a secondary tile is there a way to know that tile is gone?
I want to persist data about an object when it's pinned. And I want to be able to delete that data when it's unpinned (from the start menu).
Is there something that's fired when a secondary tile tied to your app is unpinned?
There is no event that is fired when the secondary tile is unpinned. However, you can check for your application's active live tiles by querying the ShellTile.ActiveTiles collection. Not knowing your scenario you could run this check during the various application lifecycle events.
There is a decent screen cast on how to update tiles and use secondary tiles over on http://msdev.com as well as a How-To on MSDN. Both of these show examples of using the ShellTile.ActiveTiles API.
So I have a printing component that serves a Silverlight application. Other modules in this program have the ability to signal the printing component and pass it a UIElement, which the printing component will then draw to the screen. All well and good. The problem arises when I try to manipulate the UI Element in order to better format it to fit the user's selected paper size or anything to that effect; it seems that the UI element that is passed in is frequently the exact same instance of the one on the screen, and the screen element changes itself to match the 'print-only' changes I have made. For now, I can manually save the previous values, make my changes, and restore the previous values, but it would be easier/more robust/more efficient/more flexible if I had a way to, given the UI element, make a copy of the element, and manipulate that freely, without worrying about alterations or state on the original UI element. How can I programatically copy an instance of a UI element such that I have another instance with the same visual appearance?
I know 2 ways you can try:
Save the object to a xaml string and recreate it from it.
(XamlWriter.Save and XamlReader.Parse)
Save the object with the serializer to a memorystream and recreate it from that - it is possible that not all objects are marked serializable so the other option might be the one to use.
It might seem a bit much - but there are not so many ways to create a deep copy - and not any standard c# method that I know of.