I have seen this behaviour, on an old win32 app, where when you hold down the mouse at some position on the slider track (other than on the thumb), the thumb moves to that position.
In WPF what seems to be happening is the thumb moves a distance defined either by SmallChange or LargeChange. If you keep holding, it moves by SmallChange/LargeChange again after some time as defined by the Delay property.
Now I want to get the old behaviour? So if the thumb is at 2 and I press the mouse down near 10 I want it to jump to 10. Whats the best way to do this?
Thanks in advance for any suggestions.
Slider.IsMoveToPointEnabled
I dont know how many times I went through all the properties before finding it.
Related
Maybe what I am going to ask you is unbelievable but It is my observation of Three days. I am unable to figure-out what is the problem. I have
asked my problem three times in different perspective but no luck.
Different but some kind (train) animation runs
at once on button click some animation complete on time while some not(play continuously-Don't know why). If I move my camera in the scene (a place where animation have to reach) then, my animation become complete but if I don't move or turn my camera then animation not complete even half hour passed.
I don't know what is the relation between camera and animation completion.
some things which I want to know
Why some animation complete on button click while the some not, even
the code is same and animation clips are right
Why those animation who play continuously, becomes complete as i walk
thorough my camera
What is relation b/w camera and animation play?
Is Train culling is the problem because i note that if i don't use the culling then, this problem occurring less(But occurring) as compare to train with culling.
Refer to my this question and answer. It were much disappointing that no one able to identify the problem (maybe lack of much attention to this question). After working 4/5 days finally I got this.
It were mainly animation Culling type Problem. For future use and help for the beginners like myself I am going to answer my own question here all questions are tightly associated with each other i.e., 1 answer to understand it:
Answer:
My animation culling type were selected to BasedOnRenderers which means that 'Animation is disabled when renderers are not visible'. i.e., my code were showing me that animation is playing but nothing acutal happening in my scene as my animation were far from camera view.
I solved this problem by selecting animation culling type to AlwaysAnimate (refer to this). It means that 'object is animated even when offscreen'.
Hope it will help others
I've started learning c# and vb.net and have a project related to tracking a moving object on the screen to help me learn some basics.
In essence, I will have a ball on the screen which moves from left to right (only horizontally), and when it reaches a certain point (e.g. 250 pixels from the "mid" point either side) I need to know this, and click an on-screen counter to increase a value (or decrease depending on left or right) and reset the ball to the centre (note that the ball speed will vary from incredible slow to an instant "jump").
I've been asked to look into c# and vb and decide which is best, then use it to create the program. As a complete newbie in both of these, does anyone have a recommendation and a starting point please?
My background is Javascript, HTML and very basic Java.
Thanks!
Not too sure what you define as a "Starting Point" do you mean like different C# libs to use etc. If all you are trying to do is move a ball from left to right basically and count the difference it would be so simple to do in C# XNA.
You can also do it in windows forms too which I really thing shouldn't be too hard at all. Obviously you would create the velocity formulas yourself I don't believe that's what you're asking.
One way to get the screen size in windows forms is:
public Rectangle GetScreen()
{
return Screen.FromControl(this).Bounds;
}
This will return a rectangle with a width and height that you can call, divide both values by 2 and it will give you the center of the screen. Then just add a method that is called every frame to check the balls value from the middle of the screen.
From what I've read I understand what you want to do, but I'm unsure if you just want a windows form or if you'd prefer to use a small game engine like XNA etc.
Either way best of luck and let me know :)
I am developing a game with Unity which has a main menu to allow the user select game mode. In this screenshot you can see an example:
My problem is the following:
I need to create a scroll in which user can put his finger on point 1 and swipe/slide to point 2. On the one hand, while this action is happening the element 2 increase its opacity and its position change progressively to the center. On the other hand, while this action is happening the element 1 decrease its opacity and its position change progressively to the left part of the screen.
Extra information:
The elements are sprites with colliders to detect the selection of the player.
What would you suggest me to do? Have you got any code to solve this? Any other suggestion?
Hey i think i understood your problem,
According to my understanding. You can use a binary tree for this work, u can use a sprite sheet with different level of alpha value. The variable of the binary tree responsible for changing the sprite will depend on the finger's position on the screen which you can easily get by camera.ScreenToWorldPoint(pos). also you can easily change the position of the gameObject by recording the change in initial and final position of the touchPhase.
Is there a way to detect this?
Imagine you would have an application where you are doing something and there is a Backgroundthread which is listening and waiting until the mouse will be moved - (no matter how far):
Left
Right
Left
Right
Left
Right
Left
Right
Left
Right
Which fires a trigger or calls a specific method.
Any ideas?
Don't see, from the question provided perspective to use another thread for this.
Just listen for MouseMove event over whatevere is it, and detect mouse move direction.
You can do that by substracting corrdinates recived by the event handler itself.
The thing here comes to decision of tollerance you are going to have in detection algo.
To be more clear:
If the difference of X value is bigger then (say) 1, count that as move to right, if it less then -1, count that like move to left.
Something like this.
Get the current position of mouse pointer. Move to new location. If the new location's X-Cordinate is lesser than the previuos position's X-Cordinate then it means mouse has moved left. Similary for moving right. Every time the new position will become base position. You can keep a counter and if count is 5 do what ever you wish.
Use the MouseMove event attached to your window. Store the mouse position each time it fires and compare the current position to the last position to determine if you moved left, right, or not all all (i.e. up or down).
Like mentioned what is the best way of detecting in which direction the user is dragging horizontally. I'm trying to create a camera class that responds to this gesture but am having problems determining which direction they are dragging. Any suggestions are appreciated.
Admittedly I haven't tested this, but the documentation suggests that you should check the value of GestureSample.Delta.X, which should be negative for a left movement, and positive for a rightwards one.
Because the delta is only for that particular gesture sample (not the overall gesture), you may need to accumulate it, and only trigger your drag action if the accumulated value is above some threshold (possibly upon receiving a DragComplete).