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

Pages: [1]
1
NGUI 3 Support / Popup-list's "Drop-down list" is offset
« on: April 22, 2015, 08:47:38 AM »
Hey. I've encountered a problem today. I trying to create graphics settings, so I put the Popup-list prefab in my scene. It worked completely normally. Then I changed it to how I wanted it, and suddenly this happens:



Any idea on what I've done wrong?  (I've even tried doing what I did above once more)

2
NGUI 3 Support / Global Functions
« on: March 25, 2015, 12:46:50 PM »
Hey. First, I'm not sure if this is the right forum to ask, so please tell me if it isn't. It isn't really NGUI question, but it also is...

So:
Could someone please explain to me how the global functions in NGUI work? (I mean OnClick and so on) How are they called? Is is possible for me to easily add my own global functions to my project?

3
NGUI 3 Support / Opening GUI on OnMouseDown()
« on: September 19, 2014, 10:50:50 AM »
Hey! I've got back to unity after month, and I'm trying to make an object that would say something to you, when you click on it. I have a MessageBox panel which has background, animated sprite and a label. Then I have this script on the Item I'm clicking:
  1.         public string text;
  2.         public GameObject MessageBox;
  3.         public UILabel label;
  4.  
  5.         // Use this for initialization
  6.         void Start () {
  7.        
  8.         }
  9.        
  10.  
  11.         void OnMouseDown () {
  12.                 NGUITools.SetActive(MessageBox,true);
  13.                 label.text = text;
  14.                 Debug.Log("Hello");
  15.         }
  16. }

Also on the panel there is script:
  1. void LateUpdate () {
  2.         if (Input.anyKeyDown) {
  3.                         label.text = "";
  4.                         NGUITools.SetActive(thismessage,false);
  5.                                 }
  6.         }
to close the panel and clear the message.

When I run the game (with the panel disabled by default) and click the object, it only prints Hello!, but nothing else happens. Any ideas how to fix this?


EDIT: I would also like to know if it's possible to make a panel that would set the timescale to 0 whenever it's active. I've tried but failed.

4
NGUI 3 Support / Blurry textures after one run.
« on: April 22, 2014, 11:06:22 AM »
Hey. I have this problem. When I first-run my newly built standalone game, everything looks normal. However, when it quits and I want to play it again, all the textures turn blurry. I have even tried building it on mac, but the problem persists.

I have one atlas for all sprites that is 4096x4096.

Also I have found, that when I run the game normally, then once in Unity Editor and the normally again, the textures are normal for that run.

Any help?

5
NGUI 3 Support / Selecting one item from grid
« on: May 14, 2013, 12:22:25 PM »
Hi. Well... my menu is almost done! One last thing I need to do. I have grid with items, and I want to be able to select between them. Like there are 4 countries, and when you click on one, it gets yellow overlay. When you click on another, the first loses its overlay, and the another one gets it. Could you please help me with script, or tell me if there's some tutorial somewhere? Thanks.


I know that this text doesn't make much sense, but I really don't know how else to say it...

6
NGUI 3 Support / Changing Sprite textures with script
« on: May 03, 2013, 12:53:32 PM »
Hey! I Finally almost finished my menu, but I ran into a problem. I'm trying to change sprite on Popup-list selection change. I haven't found any tutorials, so I made this post. This is my code right now (As you may know from my previous posts, I really suck at coding):
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class Pokemon : MonoBehaviour {
  6.    
  7.     public List<string> Starters;
  8.     public string pokeInt;
  9.         public UISprite BulbasaurIcon;
  10.    
  11.     // Use this for initialization
  12.     void Start () {
  13.             Starters.Add("Bulbasaur");
  14.                     Starters.Add("Charmander");
  15.                     Starters.Add("Squirtle");
  16.     }
  17.    
  18.     // Update is called once per frame
  19.     void Update () {
  20.    
  21.     }
  22.    
  23.     public void OnSelectionChange(string mSelectedItem) {
  24.         if(Starters.Contains(mSelectedItem)) {
  25.             Debug.Log("Changing Starter");
  26.             pokeInt = mSelectedItem;
  27.             BulbasaurIcon.spriteName = pokeInt;
  28.         }
  29.     }
  30. }
!!!This isn't completely my code. I just edited the code, I'm using to change Graphic Quality!!!
(and yes, I'm making a pokemon game :P)
This code doesn't show any error, but it either doesn't work, or I'm putting it onto wrong object...

7
NGUI 3 Support / [Solved]Quality Settings
« on: April 20, 2013, 02:21:12 AM »
Hey. I'm trying to make a POPUP menu, where you can change Quality Settings. I don't understand the
  1. QualitySettings.SetQualityLevel(i, true)

This is my code: (I have just edited the code from tutorial.)
  1. using UnityEngine;
  2. [ExecuteInEditMode]
  3. [RequireComponent(typeof(UIWidget))]
  4. [AddComponentMenu("NGUI/Examples/Set Color on Selection")]
  5. public class SetQualityLevel : MonoBehaviour{
  6.    UIWidget mWidget;
  7.    void OnSelectionChange (string val){
  8.       if (mWidget == null) mWidget = GetComponent<UIWidget>();
  9.       switch (val)
  10.       {
  11.          case "Lowest":   QualitySettings.SetQualityLevel(Lowest, true);   break;
  12.          case "Lower":   QualitySettings.SetQualityLevel(Lower, true);      break;
  13.          case "Low":   QualitySettings.SetQualityLevel(Low, true);   break;
  14.          case "Normal":   QualitySettings.SetQualityLevel(Normal, true);      break;
  15.          case "High":   QualitySettings.SetQualityLevel(High, true);   break;
  16.          case "Ultra":   QualitySettings.SetQualityLevel(Ultra, true);      break;
  17.       }
  18.    }
  19. }

The error says, that the Lowest, Lower, Low... doesn't exist in current context.
Can somebody please help me?

8
NGUI 3 Support / Animation on button click.
« on: April 11, 2013, 12:11:15 PM »
Hi. I'm trying to make a game menu. I have buttons, panels, and almost all things I need. Only thing I don't have are scripts. I really suck at scripting (If I was good at it I wouldn't be asking for help). I have made animation with 2 clips (which moves whole panels), and put it onto Anchor. Now I'm trying to make the animation play on a button press. This is what I got so far:
  1. using UnityEngine;
  2.  
  3. public class ClickEventReceiver : MonoBehaviour
  4. {
  5.         void OnLoadClicked ()
  6.         {
  7.                 UIButtonPlayAnimation(Anchor.Menu1); //I don't really know what to put there. Menu1 is name of the animation clip.
  8.         }
  9. }

Here is error what I get:
Quote
Assets/NewGameM.cs(7,17): error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

Any help is appreciated.

9
NGUI 3 Support / Need help with making menu!
« on: April 06, 2013, 12:03:28 PM »
Hi. Not long ago, I started with NGUI. I'm trying to make a menu with it, but I can't find how to change panels "onClick" anywhere. Nor any tween tutorials. What I'm asking for is:

1. How can I change panel (in-game) trough button click?

and

2. How can I activate NGUITween on button click?

I know these may be noob questions, but I searched trough google and I'm really helpless.
Thanks.

10
NGUI 3 Support / [Solved]My NGUI stopped working completely
« on: March 24, 2013, 06:30:25 AM »
Hi, I have been working with NGUI for few weeks, but today, when I started up unity, NGUI wasn't there. I can see the NGUI folder in Assets manager, but none of the scripts works and I cannot see NGUI button on the heading (or how is it called). Does anybody know whats the problem, or how to fix it? I have Unity 4.0.0f7 and NGUI 2.5.0.

Thanks.
Also sorry for bad English.

Pages: [1]