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

Pages: [1] 2
1
NGUI 3 Support / Re: Sprites changing to original after mouse off
« on: January 22, 2015, 07:07:02 PM »
Thanks for the answer!

Sorry, but how does one cache?

Thanks again

2
NGUI 3 Support / Sprites changing to original after mouse off
« on: January 22, 2015, 05:24:40 PM »
Hi,

I've recently upgraded to NGUI after a long period of procrastination, I'm really love it so far!

One issue I've come across is creating a button via scripting, setting its spritename. At first it works, but as soon as I mouse over and off the sprite it will change back to the sprite that it was referenced to. I've tried changing all the fields but it always reverts. I've attached some images below. Any help would be great!

Thanks


3
NGUI 3 Support / Re: Make an object always follow your mouse
« on: November 29, 2014, 12:26:29 PM »
A problem i've ran into, that I can't figure a way around is:

If I have MouseButton(0) or (1) held down then void OnHover(bool IsOver) will not work, how can I work around this?

Thanks

4
NGUI 3 Support / Re: Make an object always follow your mouse
« on: November 29, 2014, 10:41:31 AM »
I managed to achieve this by doing:

  1. public class DragGUI : MonoBehaviour {
  2.  
  3.         public GameObject DraggableSprite;
  4.         public Camera NGUICam;
  5.  
  6.         public Vector3 MoveUI(Vector3 Pos, Transform localSpace, Camera cameraNGUI) {
  7.                 Pos.x = Mathf.Clamp01 (Pos.x / Screen.width);
  8.                 Pos.y = Mathf.Clamp01 (Pos.y / Screen.height);
  9.  
  10.                 Vector3 WorldPos = cameraNGUI.ViewportToWorldPoint (Pos);
  11.  
  12.                 return localSpace.InverseTransformPoint (WorldPos);
  13.         }
  14.  
  15.  
  16.         void Update() {
  17.                 DraggableSprite.transform.localPosition = MoveUI( Input.mousePosition, DraggableSprite.transform.parent, NGUICam);
  18.         }
  19. }

5
NGUI 3 Support / Make an object always follow your mouse
« on: November 29, 2014, 09:50:44 AM »
Hi,


I am trying to make a GUI object always follow my mouse, I've tried to alter the DraggableObject script to always be true but so far havn't prevailed, is there an easier way to do it?

Many thanks

Matt

6
NGUI 3 Support / OnHover help
« on: September 05, 2014, 12:48:07 PM »
Hi,

I am wanting to debug a button that i am hovering over, mainly the details that it holds.

for example

void OnHover() {
Debug.Log(This.SpriteName);
}

How would one do this?

Many thanks.

7
NGUI 3 Support / Re: Text List auto scroll to newest message.
« on: July 11, 2014, 01:11:15 PM »
Thanks, can't beleive I missed that!

I've got another problem, I can't figure out how to link a scroll wheel to the textlist, I can't find a property that allows me to scroll the text up/down, only support mouse wheel.

The only way I can think of doing it would be:

Textlist.scrollValue = Scrollwheel.scrollValue;

Thanks!

8
NGUI 3 Support / Text List auto scroll to newest message.
« on: July 04, 2014, 04:15:29 PM »
Hi

I've been using the Text List to create a chatbox, similar to your example12.

my problem is, after I add a message it doesn't automatically scroll and show the new message, but your example does and I can't figure it out.

If i hit enter, the message gets added and i can only see it if I then click the chat box and scroll down. (kinda seems like it's upsidedown XD)

Many thanks

Matt

9
NGUI 3 Support / Re: Scaling UI sprite like EXP bar, health bar etc
« on: September 04, 2013, 08:44:39 AM »
I completely forgot about this >.< Thanks a bunch!

10
NGUI 3 Support / Scaling UI sprite like EXP bar, health bar etc
« on: September 02, 2013, 09:59:39 AM »
Hi there,

I am looking to scale many UI elements like Health bar, mana, energy and experience. I've acheived this reletively easy before with Unity's GUI system, however I am a little lost doing it with NGUI.

Originally I done it like:

  1. GUI.Box(new Rect(100 ,Screen.height - 100,PercentageCalculator(PlayerExp,ExpToLevel)* Screen.width / 150, 25), "EXP");
  2.  
  3. public float PercentageCalculator(float x, float y) {
  4.                 return(x / y * 100);
  5.         }
  6.  

However I can't controll the scale with of the UISprite using this method.

Any ideas would be appreciated!

Thanks

11
NGUI 3 Support / Re: NGUI UIGrid Sort not working properly
« on: August 03, 2013, 03:36:27 PM »
Ah crap, I'm stupid at times, 1 second after posting I realised that it works more alphabetically so it would go 0, 1, 11, 12, 13, 14, 2... Is there anyway to sort Numerically by the last digit? or should I just swap to a, b,c?

Thanks

12
NGUI 3 Support / NGUI UIGrid Sort not working properly
« on: August 03, 2013, 03:33:32 PM »


I am trying to use the UIGrid to sort my inventory here, however the sort seems to be working strange, the first 2 work okay:



Then when it hits number 3 - 9 (ID2) it jumps:



Then 9-15 (last id 14) is in slots 3+:


13
NGUI 3 Support / Password field bug
« on: August 02, 2013, 04:00:08 PM »
Hi there,

I'm having trouble using a password field. I set it in the inspector, like so:



It works fine in the editor and shows stars, but as soon as I start the game and click the password field the password bool gets set to false.



Guess i could just set it to true in update however...

14
TNet 3 Support / Re: Having trouble getting my head around Tnet
« on: July 31, 2013, 08:15:38 AM »
Okay, that makes it a little easier to understand.


However I am still at loss with the build version, the reason I asked, was not to verify a build, but to be able to just check with something on the master before connecting.

if I wanted to have this string, just for learning purposes, how would I do it? Would I edit the server source? And have it there, or would one of the clients I scripted hold it?

thanks again

15
TNet 3 Support / Having trouble getting my head around Tnet
« on: July 30, 2013, 11:37:53 AM »
Hi there,

I am having trouble understanding Tnet, mainly getting my head around how it works.

So I have the server, and a client, and somebody can be a host? but I want to leave that part out, as I want to host everything.

Now, after following the tutorial, I see most stuff is sent from the client to the server, and relayed to others. How secure is this? Wouldn't people be able to capture the packets from the client and send them to the server, or even edit data before that?

Also i'm a little confused on how the server works, would I be able to set a string on the master server for example a build number, and if the client's build number didn't match, then don't let them connect?

Also, are there any other tutorials other than the ones on your youtube?

Thanks in advance!

Pages: [1] 2