Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - broken

Pages: [1] 2
1
NGUI 3 Support / UICamera for 2D events (Colliders order)
« on: December 08, 2014, 02:29:15 AM »
Hi!

I create 2D game with game levels map like in "candy crush saga".

Unity 4.5.5, NGUI 3.7.6, 3.7.7

UICamera event type 2D World.

But I do not quite understand how to determined the order of events for the colliders.

I have structure:

- Game Map (Box Collider 2D with size = Sum of Tiles colliders bounds, disabled now)
- - Map Camera (Ortho camera and UICamera)
- - Tiles
- - - Tile 1 (Sprite Renderer with Sorting Layer = Default + 1, Box Collider 2D)
- - - - Levels
- - - - - Level 1 (Sprite Renderer with Sorting Layer = Default + 2, Box Collider 2D)
- - - - - ....
.... (N Tiles with N Levels)

For test, I added next script for each game object (Game Map, Game Time, Game Level) and checked Debug Mode for UICamera:
  1. void OnClick()
  2. {
  3.     Debug.LogWarning("OnClick " + name);
  4. }
  5.  

Sometimes shows wrong object (see attach images). For example, I clicked on Game Level object, but Debug shows like I clicked on Game Tile.
Every time when I run project, Debug shows different events order for game objects. Looks like colliders order is different.

In attach: screenshots and simplified repro project.

Thanks!

2
NGUI 3 Support / SlicedSprite border offset and Direct3D
« on: November 04, 2014, 06:44:03 AM »
Hi!

I switched back from DFGUI to NGUI and I have a question.

Unity 4.5.5f1, NGUI 3.7.5

I create simple SlicedSprite and looks like the sprite has border offset (attachments). "Use Direct3D 11" settings is disabled.
If I enable "Use Direct3D 11" checkbox in Player Settings, sprite border becomes ok.

If I'm not mistaken a year ago this was not. It is normal behaviour?

The only thing similar that I found to the forum:
http://www.tasharen.com/forum/index.php?topic=9253.msg44510#msg44510

Thanks!

3
NGUI 3 Support / Virtual Layout for ScrollPanel
« on: July 07, 2014, 12:58:27 AM »
Hi!
Long time since I was not here :)
it would be great if ngui would have a VirtualLayout functional:
https://www.youtube.com/watch?v=cMk7ZR_mw8E
Useful for ScrollPanel with lot of items.
How do you think?

4
NGUI 3 Support / Draggable Panel and Tabs changing
« on: November 07, 2013, 02:39:15 AM »
Hi! It's me again ;)

Can not figure out what's wrong (Attach video).
I have two tabs (UIToggle, UIToggleObjects) with their content.
Content: Clipped Panel, ScrollBar etc. Both contents are identical in structure, they are two different Chats (Public and Room).
When I receive the desired event from the server, I turn on the second tab (UIToggle.value = true) and show another content (Room chat).
As you can see from the video, there is some effect, as if the contents of the list shows all. It is visible only when scrolling list (either manually or through a scroll) and tab changing in same time, and only in release build (in the editor, it is impossible to detect).

Thanks!

5
NGUI 3 Support / UIInput ClampContent issue
« on: November 05, 2013, 10:12:08 AM »
Probably i found a bug with UIInput and DrawStart reset (code).

1. Create UIInput, mode Clamp Content (or open Chat Example)
2. Add button, OnClick (mInput.value = "TEST")
3. Input long text in UIInput (so that the text can not fit into the control), press Enter (OnSubmit)
4. Click button. Error.
Quote
UIInput.UpdateLabel () (at Assets/NGUI/Scripts/UI/UIInput.cs:727)
ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length

I looked at the thing. The variable mDrawStart is not reset and condition
  1. if (mDrawStart != 0)
are True.

6
NGUI 3 Support / Draggable Panel content blurring
« on: November 05, 2013, 04:06:32 AM »
Hi!

I have a panel (Clipped Panel for Chat, attach1, attach3). Sometimes when I scroll the list (with scroll, drag or scrollwheel), the content becomes blurred (attach2). Each message is a separate UILabel with BoxCollider for nickname. Elements are inserted into the table (attach4).  I have tried different settings panel, grid instead of table, but without result.
Why?

Thanks!

7
NGUI 3 Support / UILabel font size and ClampContent
« on: November 01, 2013, 04:31:30 AM »
Hi!

I use UIInput (with BitmapFonts) for my chat input. In design (photoshop) font size = 12. If i do export font (BMFont) with a similar size, it looks very bad inside Unity.
So I make export a big font size (eg 36).
For chat input i set UILabel to ClampContent (for long strings). But after I reduce the size (height dimension) of the label from 36 to eg 16, label disappears.
What should I do? How to make a small font with good quality? Is very different from the font design in Photoshop.
I have a tool ShoeBox, but it has no kerning pairs for cyrillic  :(

Thanks!

8
NGUI 3 Support / UIScrollBar Custom Foreground
« on: October 30, 2013, 04:38:36 AM »
Hi!

I have a slider that I need to do scrollbar (image):
http://i.imgur.com/dO80aES.png

As you can see, there are arrows on the edges.
I can make a sprite as Sliced to stretch only what is between the arrows. But at the same time, when I add a Sprite (Sliced) on the UIScrollBar (Foreground), it goes beyond the scrollbar at ranges of its border (arrows).
How to make normal?

Thanks!

9
NGUI 3 Support / Team Color in UITexture or UISprite
« on: October 23, 2013, 03:17:05 AM »
Hi!

How best to make the Team Color effect for UITexure or UISprite? Some of the textures (with alpha channel for example) should be painted in a color (not the whole texture, only part). For textures in 3d world objects, I wrote a special shader, but I can not figure out how to do it better on the UI textures/sprites in NGUI.

Thanks!

10
NGUI 3 Support / UICamera events for compound objects
« on: October 15, 2013, 05:33:13 AM »
Hello!

For example I have a city builder game. I have one building that has several phases of construction (eg 3). For each stage there is a separate model.
Example Game Objects Structure:
- My Building (BuildingMonoBehavior)
- - State1
- - State2
- - State3

I need to catch the click (and hover for tooltips) event for this building. But the Game Object "My Building" is a logical, and the Game Objects "State N" are the actual meshes with colliders. Can simultaneously be active only one State.
It is more logical to handle all the operations on the "BuildingMonoBehavior" and catch clicks there, too. But the events of the camera, we can only catch in "State" scripts.
How best to organize the relationship?
What comes to my mind, it's add on every state (the actual mesh object) collider and script (StateMonoBehavior) in which to write a delegate that will be called in the event OnClick. And in the root object (BuildingMonoBehavior) to subscribe to the delegates of all the states and make the necessary work.

To me it's a bit like working with lists and its elements.
But perhaps there is another solution in NGUI?

In Flash can be subscribed at the object and catch the pop-up (bubble) events such as.

Thanks!

11
NGUI 3 Support / 3D Text and UILabel
« on: October 09, 2013, 03:03:05 AM »
Hello!

Is it possible to use a UILabel to display the text in the game 3d world (as 3d text)?
I needed to use custom fonts in 3D text.
I saw on the web about the use of custom fonts in Unity with scripts http://wiki.unity3d.com/index.php?title=SaveFontTexture and http://wiki.unity3d.com/index.php?title=TexturedFont, but in the output texture is very little space between the characters and it is difficult to add a nice outline effect.
If ngui it does not, then I think i need to write own importer of fonts and mesh generator for 3D text?

Thanks!

12
NGUI 3 Support / Profiler RenderTexture.SetActive
« on: September 18, 2013, 07:02:51 AM »
Hello!

I have the simple interface created with NGUI. There have several dynamically loaded at startup textures (UITexture). Even when I'm not doing anything in the profiler can be seen spikes to the GPU - RenderTexture.SetActive (attach image). With what may be the reason?

Thanks!

13
NGUI 3 Support / Pie Chart
« on: September 13, 2013, 02:16:07 AM »
Hello!

What is the easiest way to draw a pie chart with the NGUI?
Example: http://i.imgur.com/xKdF6AN.jpg
As you can see, the colors are different numbers which together constitute a single value.
For example:
Food Ration (100%) = 10% of the apples + 75% of bananas + 15% of cherries.

Thanks!

14
NGUI 3 Support / Chat with clickable nicknames
« on: August 05, 2013, 12:01:22 AM »
Hi!

I want to make the chat window, and for this purpose chose a UILabel.
The format of messages that will be displayed in the chat about this:
"..."
"[nickname, date]: hi, this is my text!"
"..."

I need to be able to press and handle the click event on the nickname.
This need for a quick chat moderation and send private messages, or just for a quick access to the profiles of active users in chat.
How can this be done? Or what are other ways to do this?

Thanks!

15
NGUI 3 Support / UITexture and Memory leak
« on: July 24, 2013, 07:16:31 AM »
Hi!

I have two panels (UIPanel), each of which contains a texture-background (UITexture + UIStretch). One panel is initially disabled (see Attach). After switching to the second panel, I want to remove (Destroy) the first and all its contents. After removal of the first panel profiler still shows the texture in memory.

Handler (other Game Object with UIManager script) that is called when you click on the button that is located on the 1st panel:
  1. public class UIManager : MonoBehaviour
  2. {
  3.         public UIPanel panel1;
  4.         public UITexture texture1;
  5.        
  6.         public UIPanel panel2;
  7.        
  8.         void ChangePanel()
  9.         {
  10.                 GameObject.Destroy(texture1.gameObject);
  11.                 GameObject.Destroy(panel1.gameObject);
  12.                
  13.                 panel2.gameObject.SetActive(true);
  14.                
  15.                 Invoke("CleanData", 2f);
  16.         }
  17.        
  18.         void CleanData()
  19.         {
  20.                 Resources.UnloadUnusedAssets();
  21.                
  22.                 Debug.Log("Clean Data Complete");
  23.         }
  24. }
  25.  

How to free up memory or how correct to delete an object?

Thanks!

Pages: [1] 2