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.


Messages - TokyoDan

Pages: 1 [2] 3 4
16
NGUI 3 Support / Re: UIToggle trouble after upgrade.
« on: October 25, 2014, 03:26:54 PM »
Also, after upgrading should I have run any upgrade scripts?

I see 'NGUI Upgrade Tools' in my project but I thought that is for upgrading from 2 to 3.

I did do an 'Upgrade Widgets'.

17
NGUI 3 Support / Re: UIToggle trouble after upgrade.
« on: October 25, 2014, 03:24:18 PM »
Thanks but how in a function do you see what is calling it or where it is being called from?

18
NGUI 3 Support / Re: UIToggle trouble after upgrade.
« on: October 25, 2014, 03:12:34 PM »
When the game is running I can toggle them all off and get just one turned on and then they work as they should...as long as I don'T quit the game. But when I quit and restart they are screwed up again. So it is not an operation issue, it is a startup/initialization issue. In the Editor, all 6 toggles are in the same group and only one has the 'Starting State' checked. And even when I run the game in the editor I can see that only one has the Starting State checked, but all toggles look as if they are selected/on.

19
NGUI 3 Support / UIToggle trouble after upgrade.
« on: October 23, 2014, 09:47:53 PM »
I just upgraded to 3.7.4 from 3.0.8 and UIToggle is broken. I have 6 UIToggles in group 1. And only one has the Starting State checked. But all the toggles are active. If I run the project it the same, all the toggles are checked. If I manually click to uncheck all of them I can end up with only one active and checked from which point the Toggles start working correctly as before.  What changed and how do I fix it.

Also what is the "State of 'None'" option for? Of course I read the documentation but I can't understand what this means. How can it be 'none'? It is either checked or not checked.

bool UIToggle.optionCanBeNone = false
Can the radio button option be 'none'?

20
NGUI 3 Documentation / Re: UIInput
« on: August 30, 2014, 09:09:14 PM »
For the UIInput validation I know what kind of input the none, Integer, Float, Alphanumeric allow. But what do the Username and Name allow/disallow?

21
NGUI 3 Support / Re: How can I do a preview?
« on: May 10, 2014, 04:28:08 AM »
Will do. Thanks.

22
NGUI 3 Support / Re: How can I do a preview?
« on: May 09, 2014, 06:23:13 AM »
Thanks Aren.

I already got the custom script which draws the mini-map (a flat cube as a base & background) by placing the 3d objects as positions on the flat cube, making them children of the flat cube, and then scaling everything down to a properly sized mini-map. But I like your idea of an off-screen camera drawing the 3D objects into a texture so I have one question…

How does one draw 3D objects into a texture? (I never heard of that)

Regards,
Dan

23
NGUI 3 Support / How can I do a preview?
« on: May 08, 2014, 06:58:00 PM »
Hello Aren,

In my board game the boards are maps of 3D objects:
https://www.dropbox.com/s/k5ev9ho2iuqmjhs/board.png

Via the six board selection buttons on this screen I can select different board shapes and sizes :
https://www.dropbox.com/s/y7kdp0y68f8qtwp/selection.png

I want to be able to show a small preview (like a mini-map) of the corresponding board when I tap and hold on the board selection buttons.

What would be the best way to do this in NGUI? e.g. Should I use UITable? I don't need a detailed explanation. Just please point me in the direction of which NGUI classes/objects I should use.

Regards,
Dan

24
Other Packages / Re: NGUI: HUD Text
« on: April 15, 2014, 05:29:35 PM »
Thanks Aron.

25
Other Packages / Re: NGUI: HUD Text
« on: April 14, 2014, 08:01:17 PM »
Hello Aron,

Would HUD Text be good for this?

 I am making a tutorial. The user can either…

1. Tap an object on the screen and a bubble appears above/below/left of/right of (depends on location) the object containing an explanation of what the object does.

2. Tap prev/next buttons and the bubble with explanation move to the location of the prev/next corresponding object that is to be explained.

26
NGUI 3 Support / Re: Please Add Example of Toggle Buttons.
« on: March 18, 2014, 07:34:30 PM »
I got it fixed. Thanks again.

27
NGUI 3 Support / Re: Please Add Example of Toggle Buttons.
« on: March 18, 2014, 06:28:00 AM »
The Checkbox example is very confusing and doesn't address what I want to do. It activates/deactivates colored box Sprites depending on what checkbox you click.

I just want to use toggles to set UserPefs depending on what I check.

I have three buttons setup as toggles and I add the OnSelectedMapToggleChange() function to each one as an EventDelegate. I didn't attach UIToggledComponents or UIToggledObjects because I don't want to enable/disable any components or objects, I simply want to make settings in PlayerPrefs.

https://www.dropbox.com/s/uyact5j014mkcqq/ToggleProblem.png

Another thing I think is strange is executing EventDelegate.Add(selectedMapToggle.onChange, OnSelectedMapToggleChange);  causes the code in that function to be executed before I even ever tap on a button.

  1. public class TOToptions2HUD : MonoBehaviour {
  2.  
  3.         public UIToggle[] selectedMapToggle;
  4.        
  5.  
  6.         void OnEnable() {
  7.                
  8.                 // add OnSelectedMapToggleChange delegate to each toggle button
  9.                 for(int i=0; i<selectedMapToggle.Length; i++)
  10.                 {
  11.                         EventDelegate.Add(selectedMapToggle[i].onChange, OnSelectedMapToggleChange);
  12.                 }
  13.                
  14.                
  15.                 // turn off the checkmark on each toggle button
  16.                 for(int i=0; i<selectedMapToggle.Length; i++)
  17.                 {
  18.                         selectedMapToggle[i].value = false;
  19.                 }
  20.                
  21.                 // Turn on the checkmark on the toggle button according to which one was set in PlayerPrefs
  22.  
  23.                 int ind = PlayerPrefs.GetInt("SelectedMapIndex");               // get the index of map that is selected               
  24.                 selectedMapToggle[ind].value = true;
  25.  
  26.     }
  27.        
  28.         // remove OnSelectedMapToggleChange delegate from each toggle button
  29.         void OnDisable()
  30.         {
  31.                
  32.                 for(int i=0; i<selectedMapToggle.Length; i++)
  33.                 {
  34.                         EventDelegate.Remove(selectedMapToggle[i].onChange, OnSelectedMapToggleChange);
  35.                 }
  36.  
  37.     }
  38.  
  39.        
  40.         void OnSelectedMapToggleChange()
  41.         {                      
  42.                 switch(UIToggle.current.name)
  43.                 {
  44.                 case "Button-UM1":
  45.                         PlayerPrefs.SetInt("SelectedMapIndex", 0);
  46.                         PlayerPrefs.Save();                                                    
  47.                         break;
  48.                 case "Button-UM2":
  49.                         PlayerPrefs.SetInt("SelectedMapIndex", 1);
  50.                         PlayerPrefs.Save();                                                    
  51.                         break;
  52.                 case "Button-UM3":
  53.                         PlayerPrefs.SetInt("SelectedMapIndex", 2);
  54.                         PlayerPrefs.Save();                                                    
  55.                         break;
  56.                 }
  57.         }
  58. }

P.S. I thought I could possibly simplify thing by attaching a UICheckBox script to each button instead of using UIToggle but I can't find UICheckBox script. Has it been discontinued?

28
NGUI 3 Support / Re: Why did my overall UI size change?
« on: March 08, 2014, 07:30:35 PM »
I found where to change the size of that blue bounding box. In the UIRoot script in Manual Height.

(And since I am using resolution switching I got that set to FixedSizeOnMobiles.)

BUT…

Manual Height has always been 480 and it's been good up till last night. But now in order to get the size of that blue bounding box back to optimal size I had to change Manual Height to 650.
Why would the visual representation of that blue bounding box change (with no change to the Manual Height value) in relation to size of my UI layout?

NOTE: You told me to delete Anchor as it is a legacy component. But in your latest NGUI examples I looked at the Toggle example and it has an Anchor component.

29
NGUI 3 Support / Re: Why did my overall UI size change?
« on: March 08, 2014, 06:42:53 PM »
Thanks. Before this problem started my camera size was 1.35 and that setting ran perfectly sized in all builds: Web, Mac, iPad retina and non-retina, iPhone retina and non-retina.

Anyway I followed all of your advice in your rsponce and that makes the size OK in the editor, and in Mac, and Web builds. but on my iPad Retina, everything is so oversized that most of it is off screen. I haven't tried it on iPhone nor non-retina iOS devices.

Also I have been using multi-resolution aliases and resolution switching that I setup from watching and reading your tutorials and that all worked fine.

But if you could please answer my three questions about the blue boundary box and why the size could have changed (and how to change it back) I think I may be able to fine the cause of my troubles.

30
NGUI 3 Support / Why did my overall UI size change?
« on: March 08, 2014, 06:24:45 AM »
I had things perfectly with my blue backgrounded UI filling the whole 480x720 window. Then something changed and made the whole UI smaller so that there is a white boundary around my blue backgrounded UI. The funny thing is it changed while I was working on another UIPanel. My hierarchy is:

NGUI Camera
--Anchor
----UIPanel1
----UIPanel2
UIpanel1 holds game settings1 and UIPanel2 holds game settings2. I enable/disable UIPanel1/UIPanel2 depending on which settings I want to show.

I was comparing everything to an old project in which the UI background is sized correctly, and the only difference I could find was the size of a purple box that shows when I select one of the UIPanels in the editor. In the old project the size is H=504, w=336. But in the new 'broken' project the size is H=680, w=725.

1. Why would the size of this purple box change when I didn't change it directly?
2. How can I change it back to the correct size? (I can drag the handles on the corners or sides).
3. What does the purple box represent?

Note: This kinds of weird 'automatic' changes often happen without any direct size manipulation on my part and I don't know why.


Pages: 1 [2] 3 4