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

Pages: [1] 2 3 4
1
NGUI 3 Support / Re: I2 Localization for NGUI
« on: June 11, 2014, 12:34:26 PM »
Hello,

Whats the process for changing fonts with NGUI? In the secondary tab, if i select font, it changes the type in the main tab as well : /

Can you also allow multi object editing? Would be incredibly helpful.

2
NGUI 3 Support / Re: Novint Falcon Controller; Raycast from sprite position
« on: November 05, 2013, 06:40:31 AM »
Ah I see, I was doing that outside of such a function so it'd be a good idea to wrap it all together in a single method. Cool. I get that.

How about UIcamera.lastHit? Can i just set that or do i need to do anything fancy to stop that from using the mouse?

3
NGUI 3 Support / Re: Novint Falcon Controller; Raycast from sprite position
« on: November 04, 2013, 08:12:04 AM »
Hello Aren,

I've been looking at different posts you made on the subject but it's not entirely clear to me how to do it.

The custom cursors moves now with the Falcon control and I send out clicks and the raycasts work fine. But obviously i need have an issue with MouseOrTouch not existing and returning null.

What's the prefered way to handle this? If it's the CustomInput on the camera, could you explain how that is meant to work?

I understand that it's a delegate calling my own methods, but what variables would i need to set on UICamera to get all my bits working correctly? Right now i'm meant to click, drag and drop items.

4
It's working now, that's cool. But the currentTouch will be null.. i guess that's why the CustomInput thing exists?

5
Aaaah right! Nice one. I will report back if I run into anything else. Thanks for spotting that!

Cheers

6
If you look at the code I posted I convert the localpostion using WorldToScreenPoint before putting it into the raycast, is this the incorrect way of going about it?

7
But i dont think I need to go that far? I mean.. the sprite is already in position correctly.. How can I do the raycast from that position? The above code doesnt appear to work.

8
Not sure what to do with this. The docs are pretty vague.

The falcon controller doesnt take over the mouse so the only input from that is some delta and a bool. So i just move a sprite around to act as a cursor. But raycasting from it's position doesnt seem to work.

Could you clarify how i can use OnCustomInput?

9
NGUI 3 Support / Novint Falcon Controller; Raycast from sprite position
« on: October 28, 2013, 05:11:39 PM »
Hello,

I was given a Novint Falcon controller to play with in a unity project. Sadly the controller doesnt actually replace the regular mouse so i'm having to roll my own controller.
A sprite is functioning as a cursor that i move around using a delta given by the Falcon. I have also written a button handler but i can't seem to get the raycasting sorted.

Is there an easy way to get a raycast going in NGUI using a sprites position instead of the mouse?

  1. if( Haptics.isButton0Down() && !middleButtonPressed )
  2. {
  3.         middleButtonPressed = true;
  4.         //Raycast
  5.         RaycastHit hit = new RaycastHit();
  6.         if( UICamera.Raycast(  UICamera.mainCamera.WorldToScreenPoint( mTrans.localPosition ) , out hit ) )
  7.         {
  8.                 Debug.Log( hit.collider.name );
  9.                 //SendMessage( "OnClick");
  10.                 //SendMessage( "OnPress", true );
  11.         }
  12. }
  13. else if( !Haptics.isButton0Down() && middleButtonPressed )
  14. {
  15.         middleButtonPressed = false;
  16.         //SendMessage( "OnPress", false );
  17. }

10
NGUI 3 Support / Re: Bug when resizing sliders
« on: October 23, 2013, 05:45:16 AM »
A similar issue occurs in the Scroll Bar. But mostly when the scroll bar bip is set to a smaller size. It tends to default to some hard coded value someVal x 121. No idea how to fix this.

Something weird going on with the sprite types. I noticed it's to do with sliced sprites.

11
Problem has been resolved. I was calculating the start and end position incorrectly in the OnDrag method. Calculating the bounds and simply using those has fixed it.

12
Ive attached a webbuild to illustrate the behavior.

Just drag the existing one into the timeline, move the arrows a bit. then click a button on the left and drag that one into the scene. It should turn red if it's covering the one already in there.

13
Hello,

Ive created a timeline in Unity where you can drag and drop sprite into and then you can drag the sprites at the sides to increase/decrease the width.

It all works great except that i cant seem to determine the centerpoint and the start and end of the widget. Its built as follows:

Container - With a manager script for the objects interactions
      - Background sprite with collider for dragging
      - Arrows for resizing

The code can be seen here: http://pastebin.com/FfzRwKpq

Below is the code i use to see if a clips end or start point overlaps with that of another object in the time line
  1. !timeline.Any( o => o.ValueObject.start <= vo.end && o.ValueObject.end >= vo.start )

But this is giving me very inaccurate results for some reasons. The center point of the clip seems to be fine but any time i check the start and end points it gives very weird results as if the box is shifted over x-amount of pixels.

14
I did some more googling and came across this post: http://www.tasharen.com/forum/index.php?topic=62.0

ArenMook suggests what i currently do, although instead of instantiating a copy i create a whole new gameobject set up the way i want for what ever purpose. But it's not receiving an mouse events it seems.

[Edit]
Seems the collider was being set to 1,1,1 in size : /
However the following issue is left. If i try to drag the scroll view, the button I drag on makes a copy as i use OnDrag in the button to create a copy for dragging.

Requirements:
Drag a copy of an item off of the list without the scrollview following mouse movement
Still be able to scroll the view since it use OnPress to init dragging

15
NGUI 3 Support / Drag from scrollview; Creating a copy of selected item
« on: October 08, 2013, 10:20:50 AM »
Hello,

I have a scrollview with a bunch of buttons you can press. What i want to do is if you press a button and drag off of it, a copy should be attached to the mouse that you are able to drop on some area.

I create the copy fine but two things happen. It doesn't react to OnPress( false ) when i release the mouse. And the scroll view keeps moving when i move the mouse up and down.

What would be a solution to fix the scroll view and let the object react to the mouse event sent?

Pages: [1] 2 3 4