Unity slider interaction with controller - user-interface

So I have a laser pointer attached to my controller, shooting rays and triggering events whenever I press the tigger.
Tho it still has one or two buggs (Unity VR Controller UI Interaction), I have a more general question.
The UI needs some kind of slider. And I can't figure out how to make my pointer collide with the slider and behave in a slider-ish way. When I press my button, it currently ends up setting the slider to zero and not letting me drag it.
Thankful for any tipps on how to make them actually slide, since my ridgidbody-cube doesnt move and doesn't allow movement! Unitys documentation on e.g. the beginDragHandler isn't really helpful...
Cheers, Flo

If your enter/exit events already works, juste check the x (or the axis corresponding on your slider) of your "laser" every frame or so, and increase/decrease the value of the slider based on the delta between two check.
Hope it is clear, it should not be hard if you already have your events sets up !

Related

Between windowDidMove and windowWillMove

I've been trying with windowDidMove and windowWillMove (NSWindowDelegate) but I think I need something between these two...
Is there any other way to detect when I move my window in cocoa?
I mean - I want to trigger a function if I drag a window to the bottom of the screen, but I want this function to be run even if I didn't yet release the window?
The middle ground you are seeking is handling the mouse events yourself and implementing the window dragging. If you do this you determine how dragging works; so you can constrain the window to an area of the screen, trigger events when the window reaches a screen edge, etc.
You'll need to do some reading, you could start with Apple's Handling Mouse Events.
If you have problems once you've done the reading, written some code, etc. ask a new question, showing your code, and explain the problem you've hit. Somebody will probably help you out.
HTH

Trying to add my animation to my idle state, but it just keeps saying "None(Motion)"

I have pulled the animation to the Motion tab both by dragging and trough the select motion search function but neither makes the animation stick to my idle state. Can someone give me a pointer to what im doing wrong?
One reason could be that the animations are marked as legacy.
Select one or many animation, in the inspector next to the lock, right click, then Debug. Untick the Legacy. No need to save or else.
The animation which you're trying to set is for another model!
You should use an animation that is for the model.
Or if you insist on using that animation select animation from assets and do a "Control + D" to duplicate it and use new one.
Use the Animator, not the animation controller. I made this mistake when I was following a tutorial. This is only relevant if you are animating .anim files within unity itself. Animation controller is the way to go if you import animations for your specific model.

Drawing on an image which is inside a QScrollArea?

If I subclass QLabel and I add a QLabel directly to my QDialog, it works fine. If I add this label inside a ScrollArea, the thing I’m drawing doesn’t show unless I resize the dialog itself. Yes, weird.
I’ve setup compilable example code that indicates what the problem is. What I am trying to do is to select an area of an image with my mouse, by drawing a rectangle on the corresponding area. The images my program is designed to work with can be very large, and thus, I need to have a scroll area so as the dialog to stay at a logical dimension, and not to fill the entire screen (or even multiple workspaces, if we are talking about a linux machine with multiple desktops).
Everything works fine, except that the drawing (selection-rectangle) isn’t visible unless the dialog is resized – manually. I think I have to update something while drawing, but I’m not sure what. Well, here’s the example code: http://paste.ubuntu.com/1151553/
Another issues that I don’t know how to solve (and I want your suggestions there) are (1) when the user is selecting an area, how to set it to automatically scroll when the user actually selects an area by pushing against to a wall of the scroll area (I guess I am understandable here). (2) is there a way to let the user select a rectangle and then, when he left-clicks on a position with holding down the [Shift] button, the bottom right edge of his previous selection to actually go through the point he clicks at?
The documentation indicates that you have to set a Layout somehow somewhere, but I'm not sure how to do this to my occassion.
Thanks in advance for any help.
about problem (1):
just use of Event. i think mouse Enter Event or Leave Event is good for that.
and to do that i think you can use a hidden rectangular that fill the whole of the screen.
and over write the mouse leave Event for that rectangular and tell in that function , to scroll the page.

Customizing slider in WP7

I have experienced some trouble with the Slider control on WP7. When I am dragging it, it will only drag a little bit, and then it goes back to where it started. If I let go of the slider quickly, then it goes a little further. E.g. if you want to drag it from the start to the end, you will have to quickly drag many times. What I want is a smooth slider, which follows my finger and stops until I release my finger, and it should stop where my finger is. Any way to get this the way I want?
I am also having a bit of trouble customizing it visually. How can I resize it and put it in the middle of the parent controller? Now, it puts itself in the top section, even though Vertical option is set to bottom..
How do you know where your finger are? Your finger is obviously going to be larger than the Slider itself.
The default slider is perfectly smooth. So all you're complaining about is the level of precision. You won't get 100% precision with a touch-interface that depends on the calibration of touch-input on your touch-screen.
Either you make the slider go in steps (which isn't smooth), or you accept the lower level of precision.
I finally solved the issue. The problem was that you can not(for some odd reason) have a slider and a gesturelistener at the same page. I removed the gesturelistener and the slider was smooth. I will not call that bad programming skills, this is definitely a bug, because the gesturelistener was on a totally different control in the page.

handling issue with listbox in a pivot

I'm working on a app in which I used a listbox inside a pivot control just like the outlook app does. The problem is sometimes when I scroll the list, a swipe gesture is triggered and it goes to another pivot item. This is very annoying, and it seems doesn't happen to the outlook app. Am I doing something wrong? How do I fix it? Thanks a lot.
If you're just using the default controls in the default way then you're not doing anything wrong in your code.
You haven't said if you're getting this on the emualtor or on an actual device. I find I sometimes do this on the emulator if holding the mouse at a slight angle or on an actual device if holding that in a funny way (such as when lying down).
Whether you scroll the listbox or the pivot will depend on whether your finger (or mouse-if using the emulator on a non touch-screen PC) first moves vertically or horizontally after first touching the screen. In my experience the scenarios described above can lead to this not always working as expected but I've never seen an issue with this on a real device being held in one hand and scrolled using a thumb.

Resources