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

Pages: 1 [2] 3 4 ... 9
16
NGUI 3 Support / Re: Show UILabel/Sprite above Player?
« on: April 21, 2014, 09:30:13 AM »
Mhm, I figured something out. I have a script which is responsible for a smooth (Main)Camera-Follow.
I noticed, when I remove that script, it works how it should!

This is what's happening in the script:

  1. void Update ()
  2.         {
  3.                 Vector3 _tmp = thisTransform.position;
  4.  
  5.  
  6.  
  7.                 if(target.position.y < level_minY)
  8.                 {
  9.                         _tmp.y = Mathf.SmoothDamp(thisTransform.position.y, level_minY,
  10.                                                   ref velocity.y, smoothTime);
  11.                         thisTransform.position = _tmp;
  12.                 }
  13.                 else if(target.position.y > level_minY && target.position.y < level_maxY)
  14.                 {
  15.                         _tmp.y = Mathf.SmoothDamp(thisTransform.position.y, target.position.y,
  16.                                                   ref velocity.y, smoothTime);
  17.                         thisTransform.position = _tmp;
  18.                 }
  19.                 else if(target.position.y > level_maxY)
  20.                 {
  21.                         _tmp.y = Mathf.SmoothDamp(thisTransform.position.y, target.position.y,
  22.                                                   ref velocity.y, smoothTime);
  23.                         thisTransform.position = _tmp;
  24.                 }
  25.  
  26.                 if(target.position.x <= level_minX)
  27.                 {
  28.                         _tmp.x = Mathf.SmoothDamp( thisTransform.position.x,
  29.                                                   level_minX, ref velocity.x, smoothTime);     
  30.                         thisTransform.position = _tmp;
  31.                 }
  32.                
  33.                 // ABSOLUTER PUNKT RECHTS
  34.                 else if(target.position.x >= level_maxX)
  35.                 {
  36.                         _tmp.x = Mathf.SmoothDamp( thisTransform.position.x,
  37.                                                   level_maxX, ref velocity.x, smoothTime);
  38.                         thisTransform.position = _tmp;
  39.                 }
  40.                
  41.                 // ANSONSTEN FOLGEN
  42.                 else
  43.                 {
  44.                         _tmp.x = Mathf.SmoothDamp( thisTransform.position.x,
  45.                                                   target.position.x, ref velocity.x, smoothTime);
  46.                         thisTransform.position = _tmp;
  47.                 }
  48.         }


What sould I change in order to get it to work with the Camera-Follow?

17
NGUI 3 Support / Re: Show UILabel/Sprite above Player?
« on: April 20, 2014, 04:37:18 PM »
Both are visible at the same time!

18
NGUI 3 Support / Re: Show UILabel/Sprite above Player?
« on: April 20, 2014, 01:12:51 AM »
The Player is on "Default" and the MainCamera renders Default and some other Layers but not the GUILayer.
My UI-Camera renders only the "GUILayer".

19
NGUI 3 Support / Re: Show UILabel/Sprite above Player?
« on: April 19, 2014, 08:32:17 AM »
Alright. I had a look and it is indeed what I was searching for. The problem is now: I can't get the desired results. Have a look:

So this is my Label in the center of the UI (The label is a child of a Panel)


As you see the Target is the Player-Transform.

But as soon as I hit play, the Label moves to the lower right of the UI.


Of course in the Game-View the Label is displayed in the lower right. I want it to "hover" above the Player.

Wrong settings?

20
NGUI 3 Support / Show UILabel/Sprite above Player?
« on: April 17, 2014, 05:02:33 PM »
We're working on a 2D game, and sometimes our Character talks with others while the Main-Camera is centered.
We want them to have Speech-Bubbles with Text above their heads.
We thought it would be nice to achieve that with NGUI.

Is there a quick way to display an UILabel/Sprite from UIRoot and it's camera over the position of the 2D-Player-Sprite and his MainCamera?

21
NGUI 3 Support / Re: Comparision of NGUI over new uGUI
« on: April 02, 2014, 02:38:52 AM »
Well, I guess but the people who have Beta-Access can't talk very much about uGUI.
If you don't have Unity Pro, then the option to Atlas your UI-Sprites with NGUI is great, since Atlassing is a Pro-Feature only.

22
NGUI 3 Support / Re: How long was a button pressed?
« on: March 11, 2014, 05:03:54 PM »
Damn. Of course!

23
NGUI 3 Support / How long was a button pressed?
« on: March 11, 2014, 11:20:48 AM »
Hey there!

Is there a nice way to measure the time while pressing a button?
Meaning: When I press and hold a button a "timer" should go off and if it the button is pressed long enough something happens.

I searched the forums already and only got some older postings where recording the time in OnPress and checking it in Update was suggested. A legit and good idea, but here's the thing:

When the button is pressed long enough there should "popup" another GUI-Window (Widget, Sprite etc.) with a label asking the Player something specific.
I wanted to achieve this with Coroutines and NGUI-Tween-Events. Coroutines don't work properly in Update() and I don't want to add Events every frame in Update() while the "timer" fulfills the condition.


  1. void OnPress(bool pressed)
  2. {
  3. if(pressed)
  4. {
  5. // I know this won't work, but I add it anyways, so you get my idea:
  6.  
  7. timer += Time.deltatime;
  8.  
  9. if(timer >= x)
  10. {
  11. // Start Coroutines
  12. // Do cool Eventstuff
  13. }
  14. }
  15. }


Any suggestions? :)

24
NGUI 3 Support / Re: Atlas Maker issues
« on: March 07, 2014, 01:07:02 PM »
Haha, got the same problem today: http://www.tasharen.com/forum/index.php?topic=8480.0

My solution was: changing the project from 2D to 3D. If you remember, on Project-Creation you can choose if you want Unity to setup the Project in 2D or 3D Mode. I used the 2D one in that project for the very first time and it gave me these problems.

Maybe it will help you, too.

25
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 11:09:07 AM »
Ah, found it! Yeah, that did the job. God...this is so...dumb :/

Anyway, thanks so much for the help! This bothered me the whole day, uff...

26
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 11:05:45 AM »
Uh, I don't know why I don't get this error :/

And I don't know why the Texture is set to 16 bit. This happens automatically when the Atlas-Texture is created, it also sets it to "Sprite" automatically. How do I turn the 2D Mode off?

27
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 10:43:20 AM »
Yes, I'm targeting iOS for now. I looked up the Quality-Settings and besides setting iOS from "Simple" to "Fantastic" and using "Full Res" I couldn't find anything else which limits the Texture Size.

Tried it again: same behaviour as before. When I select everything I need the Atlas-Maker limits the Atlas to 1024x512.
(4096x4096 is selected btw.)

I also tried to set all the imported Sprites to a bigger size like 2048 or 4096 (override for iPhone is selected!) and then to create the atlas. Doesn't help at all.

I tried that with setting the imported Sprites as "Sprites" and also as "Advances Textures". Always the same stuff :/

28
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 10:08:03 AM »
Unity doesn't freeze, but I can't use the Atlas-Maker. While the Progress-Bar is active and I click for example "View Sprites" in the Atlas-Maker I can't close the View-Sprites-Window anymore.

But I have one question: is this behaviour intended?

Just for testing I created an Atlas with 4 big sprites with these dimensions: 865x627
And for some reason it's creating an atlas with 1024x512.
Shouldn't the created Atlas be...bigger?



As you see, some sprites are squeezed into one "field".

So I looked up the Atlas-Texture:



And changed the "Max Size" Value to 2048. As soon as I did, the Atlas was "updated" immediately and the big sprites looked like they should:



When I add new Sprites to the Atlas and use Add/Update I get another MissingReferenceException, being again stuck in the Updating-Progress-Bar, but there I can click again on Add/Update and by doing so the other sprites are added accordingly and everything looks fine.

Though this "looks" fine this is way to unstable for me and a really bad way of handling the creation of an atlas and updating it!

What bothers me the most right now: is this of the latest Unity Version or NGUI Version? Before updating from NGUI 3.5 to 3.5.3 this didn't happen at all.

29
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 09:45:31 AM »
Yes! I'm trying that right now!

If I'm on big sprite and some small ones it's ok, but at a certain amount of sprites it's starting to look weird :/
And sometimes I'm just stuck in the "Updating"-Progress-Bar and nothing happens and I have to ForceQuit Unity.
This is NOT ok! :(

30
NGUI 3 Support / Re: Problems with Atlas-Creation
« on: March 07, 2014, 09:20:29 AM »
Yeah, I also tried that for hours now and it doesn't help at all.
When I the Atlas is created, with the weird looking results, I tried it to Add/Update. Then, AFTER creation it gives me the MissingReferenceException again when I add/update it.

I'm sitting here now for some hours with empty projects and different sprite-graphics, some which are used in production and some I just made for testing purposes -> nothing works.

I'm using the latest Unity version btw. Are there any specific new settings I have to take in mind? The .PSD Files I'm importing are automatically set to "Sprite" as Texture Type with Pixelts to Unit = 100. I guess these values are alright that way?

Pages: 1 [2] 3 4 ... 9