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 - Thurinus

Pages: [1]
1
NGUI 3 Support / UIPopupList popup isn't sizing and positioning correctly
« on: November 21, 2014, 04:44:04 AM »
I'm creating a dropdown menu following the example scene's popup list, using my own sprites and font

Problem 1: dropdown sizing
the width of the dropdown is smaller than the original button that spawned the dropdown. Digging through the code, I found this line:

  1. // The triggering widget's width should be the minimum allowed width
  2. x = Mathf.Max(x, bounds.size.x * dynScale - (bgPadding.x + padding.x) * 2f);

The problem seems to stem from dynScale being indirectly calculated to be less than 1, from its activeFontScale assignment where it's stated to be fontSize / bitmapFont.defaultSize if a bitmap font is specified. The problem doesn't appear in the example scene because the dropdown font is native sized, but I have a big font that I've scaled down a bit. I hope I don't have to create another smaller font atlas to work around this :P

Problem 2: dropdown positioning
Seems like if the list is just a bit longer (say maybe 10 values or more), the dropdown will be positioned further down and no longer adjacent to its spawning button, even if it wouldn't go beyond the bottom of the window if positioned correctly. This happens in the example project if I add more options to either one of the example popup lists.

Am I missing something, or are these actual bugs?

Thanks for any help!

2
TNet 3 Support / [Solved] Proper way to start and join a server?
« on: November 17, 2014, 05:47:40 AM »
Hi all,

I'm new to TNet, and relatively new to realtime networking in general (coming in from SmartFox). I'm trying to figure out how to properly execute a certain user flow in TNet.

I have a publicly accessible lobby server. Users are expected to either join an existing game server by connecting to a server found on this lobby, or host their own game servers and registering it with the lobby server. I want those that host their own game servers to automatically join their own servers upon creating them. Right now I call TNManager.Connect("127.0.0.1", tcpPort); in a coroutine after waiting a second from a TNServerInstance.Start() call. Calling TNManager.Connect() right after in the same function doesn't seem to work... or at least OnNetworkConnect() doesn't seem to be invoked when done that way.

2 immediate questions from this exercise:
  • Is calling TNManager.Connect() on 127.0.0.1 this the proper way to go about forcing a host to join his own server?
  • Having to call TNManager.Connect() after a coroutine wait feels a bit hackish... is there a more graceful way to go about this without requiring user input?

Thanks for any help!

3
Using NGUI 2.5.0c

Hi all,

I'm trying to get a background sprite to hug a UILabel that can have a variable width up to a certain max width. I've been referencing the UITooltip code that resizes the background to the UILabel. The problem with this approach is that if I have a UILabel with a lineWidth set, the background will always enclose the full lineWidth regardless of the amount of text in the UILabel. Is there a way to make the background shrink to the text if the text takes up less space than the full line width?

Thanks!

4
Hi all,

We're still using NGUI 2.6.x, and are having trouble with creating a UISlider that would situate the thumb properly when clicked or dragged. Attached is a video captured on the Scene and Game windows to demonstrate the problem:
http://screencast.com/t/hwcLPsNj

This was a slider created straight from the Widget wizard, with the foreground removed. Notice how the thumb seems to be offset by half the width of the slider. I made sure that the collider was offset correctly to line up with the background. Anyone know what might be going on? Let me know if more information is needed to diagnose the problem, thanks!

Jay

5
Hi everyone!

I've been trying out UIDragObject, and am wondering if there's a way to clip the dragging to the viewport? I tried to put the draggable items into a Panel that normally fills the viewport, but in order to get clipping to work properly to constrain the draggable items, I had to set the UIPanel's clipping size. Is there a way for the clipping to size based on the viewport size, or is there another way to achieve what I want to do that involves a different method?

Thanks for any help
J

6
Specifically, I'm trying to figure out a way to implement a relatively hefty tooltip that comes up over and to the left of a cell within a UIGrid within a UIDraggablePanel. Making the tooltip a child of the cell causes UIDraggablePanel to see that as extra dimension it must compensate for, and thus will shift the cells to the right to accomodate the tooltip. Is there a way to have UIDraggablePanel ignore the tooltip without having to take it out as a child of the cell? (I ask for this specific use case because there are other things we want to happen in the cells that will push its boundaries as well)

Thanks for any help!
Jay

7
Hey all,

I have a UIGrid within a UIDraggablePanel. The UIGrid has a bunch of GameObjects that have Buttons in them. What I want to do is have the Buttons accept clicks when the user taps on the Button, but defer drags to the UIDraggablePanel if the user touches the Button but starts to drag. Is there a good way to do this, if it's even possible?

Thanks!
Jay

8
Hi all,

I'm implementing a mobile-based drag panel (no scrollbars), with a UIGrid under a UIDraggablePanel. the UIGrid's children change in number at certain points in the game, and I'm seeing an issue where the children will sometimes be out of the draggable panel window range, and will only come into range when the panel gets scrolled. The children will stay within sight thereafter. Is there a way to reset the panel after children get replaced? I've setting UIGrid's repositionNow field to "true" and calling Reposition() directly after the children replacement, but no dice.

Edit: I also tried calling UIDraggablePanel.ResetPosition(), but that didn't help

Thanks for any help!

9
Hi everyone,

This may have been a previously addressed problem, but I don't know what to search for, so thought it couldn't hurt to ask.

Scenario:
I'm making a market with a scrollable panel that I populate with cells. This market will show all items in these cells, even those locked by player level. The cells representing items locked by player level are to be overlaid with a dark, translucent layer with a UILabel over it saying "Unlock at Level X".

Layout:
The cell's background is drawn from an atlas named "UI Atlas". The item images in the cells are drawn from "Item Atlas". The dark, translucent overlay is also drawn from "UI Atlas".

Problem:
I want to draw the the dark translucent overlay over the Background and the Item Image (Background|Item Image|Dark Overlay), but it seems to only allow me to draw sprites from each atlas either entirely over or entirely under the other atlas (Background|Dark Overlay|Item Image) or (Item Image|Background|Dark Overlay), no matter how I manipulate depth or physical Z-position. Since these cells are within a scrolling UIPanel, I cannot use UIPanel to discreetly draw the Dark Overlay. Is there another way to do what I seek with what atlases I have, or am I doomed to be forced to create another atlas just to hold the Dark Overlay sprite?

Thanks for any help!
Jay

10
NGUI 3 Support / Making modal dialogs - want a "dimmer" background
« on: December 07, 2012, 03:16:22 PM »
Hi all,

First off, I apologize if this question turns out to be sophomoric.

Okay - so I'm trying to create a dialog with NGUI where the background gets masked by an alpha'd layer to make the dialog pop out more. I'm thinking of doing this by adding a UISprite and assigning it a flat-colour, alpha'd sprite, and then blowing up its size to cover the entire screen, and laying the dialog over that. I'm wondering if there's a better way to do this, perhaps even maybe without needing the physical sprite (i.e. creating the texture at runtime)?

Thanks for any help!
Jay

11
NGUI 3 Support / Does tweening work on UIPanels?
« on: October 24, 2012, 05:46:47 PM »
Hi again,

I tried looking on the forum for hints to this problem but found nothing that addresses it directly so I thought I'd ask...

I'm trying to create dialogs that will pop up over an omnipresent HUD. I do this by creating prefabs for the dialogs and adding them to the main panel using NGUITools.AddChild() at runtime. The dialog prefabs themselves have UIPanel components attached to them. When I add them using AddChild, they display fine, but when I tween them using TweenScale (from vector 0 to 1), I noticed that the background and button images don't draw, although the gizmos representing them seem to be tweening properly. I tried narrowing down the problem by turning off the UIPanel component and turning off tweens, and it seems to point to UIPanel not responding well to tweens.

I'm using UIPanel for the top level of every dialog prefab because i don't the depth to clash with the HUD, and I don't want to force our artists to keep track of depth through the entire UI (HUD and dialogs share the same atlas). Am I using UIPanel for the right reasons, and if so, how do I solve the tweening issue?

Thanks!
Jay

12
NGUI 3 Support / UITweener - what's the proper way to add new "Methods"?
« on: October 24, 2012, 04:14:03 PM »
Hi!

I see that UITweener has a bunch of predefined methods, or 'ease' algorithms, and am wondering if there's a proper way to add to it? One that I'd like to add is an Elastic effect. I noticed that the easing algorithms are all listed in a string of if-elses. Is there a way to add to this without modifying UITweener? I prefer to keep library code pristine whenever possible :)

Thanks!
Jay

13
NGUI 3 Support / Replacing fonts - what's the proper way?
« on: October 22, 2012, 03:18:11 PM »
Hi everyone!

Just started evaluating NGUI, and am hitting something that isn't a roadblock for now but will probably be down the line if we have to replace fonts. Sorry if this has been brought up before.

I've exported a font from GlyphDesigner, and created a Font Atlas in Unity. However, I wanted to resize the font texture, and decided to recreate the font atlas, hitting "Replace the Font" to re-render the texture to the main Atlas. This caused all existing labels that used the font to look illegible due to badly-mapped fonts, and I couldn't fix it without replacing every label. Is there a way to replace fonts without having to replace every label that uses them?

Thanks!
Jay

Pages: [1]