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

Pages: [1]
1
NGUI 3 Support / Constrain to UI Panel
« on: September 27, 2017, 03:10:52 PM »
Hello!

Trying to work my way around an issue. Basically what I am trying to do is ensure that a UIlabel here always stays within the borders of the UI Root's panel.
https://www.dropbox.com/s/o28oj3nq01lo7nz/WithinBorders.mp4?raw=1
(This video showcases the problem quite exactly)

I've fiddled around but I can't really find the "right words" in NGUI to confine this UI element within the bounds.
Very grateful for the help  ;D

2
NGUI 3 Support / Typewriter OnFinished(), stop animation
« on: June 27, 2017, 03:05:23 PM »
Hello!

Having a bit of an issue here.
Basically I'm adding a typewriter component to a gameobject via my script, and setting its variables. Like fadeintime, charspersecond and so on.

But I also want to make it so that when the typewriter component is finished it will broadcast a message. (Basically, I want it to disable an animation bool of an animator. Sort of when the typewriter effect is done it stops a talking animation)

To put it in blunt, wrong code.

  1. void BeginTalk () {
  2. var Typewriter = Text.AddComponent<TypewriterEffect> ();
  3. CharacterAnimator.SetBool ("Talk", true);
  4. Typewriter.onFinished = StopTalking()
  5. }
  6.  
  7. public void StopTalking(){
  8. CharacterAnimator.SetBool ("Talk", false);
  9. }
  10.  

How would I got about assigning/setting up a proper delegate here. I'm a little confused :)

3
Misc Archive / Floating Text Almost Works Perfectly
« on: March 31, 2017, 04:09:11 PM »
Hello, so I got this script

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class HoverOverGameobject : MonoBehaviour {
  6.         public GameObject target;
  7.         public GameObject UIElement;
  8.         public Camera UICamera;
  9.         public Camera WorldCamera;
  10.  
  11.         void Start() {
  12.         }
  13.  
  14.         void LateUpdate() {
  15.                 WorldCamera = NGUITools.FindCameraForLayer (target.layer);
  16.                 UICamera = NGUITools.FindCameraForLayer (gameObject.layer);
  17.  
  18.                 Vector3 pos = WorldCamera.WorldToViewportPoint (target.transform.position);
  19.                 pos = UICamera.ViewportToWorldPoint (pos);
  20.  
  21.                 transform.position = pos;
  22.         }      
  23. }

And it works perfectly at 16:9 or 16:10 aspect ratio.
But below that, it suddenly sorta lags to the side and isn't right on top of the object. I'm wondering if any of you could have some helpful advise on how to fix this? :)

Pages: [1]