Is there a way to independently use the left and right sides of the drag event? - unreal-engine4

In Unreal's blueprint, I want to use the right and left sides of the UI Canvas in different ways. This can happen separately, but it can also be used at the same time. While currently using the left drag, the drag event for the left calls the drop event the moment you press the right. Is there a way to maintain the drag event for the left even if you press the right side while using the left drag?

You can make two different onDrop arena ;; you can make 1 and pick function based on drop position using pointer event ;; you can use in smart way onDrop run priority or you can make other way.

Related

How to shift the drag and drop feedback to the left?

I am building a chess board component, in which we should move the pieces by a simple Drag And Drop. In order to ease the drag and drop, I also try to draw a feedback which is a "cross of cells" centered around the pointer.
So, I am trying this way :
I draw a container that starts at the pointer location
Inside that container, I draw the entire cross, also drawing the dragged piece at the center of this container
So, I need a way to shift that feedback half to the left and to the top. That is, I need the feedback to be positionned to left and to the top of the pointer location.
Is that possible ?
I've tried playing with feedback and dragAnchor properties of Draggable, but I did not achieve.

GTK prevent custom widget from grabbing focus

I've implemented a musical keyboard as a subclass of Fixed and where each individual key is a subclass of DrawingArea, and so far, it works great: custom drawing code in expose, press+release functionality working... kind of. See, here's the problem: I want the user to be able to drag the mouse across the keyboard with the mouse down to play it. I currently capture the button press and release signals, as well as enter and leave notify. Unfortunately, this doesn't quite work because the widget seems to grab focus of the mouse as soon as the mouse is pressed over it. This makes sense for normal buttons, but not for a musical keyboard. Is there any good way to remedy this other than rewriting the entire keyboard to be one massive DrawingArea?
Also, it shouldn't matter, but in case it does I'm using GTK#.
You might consider using GooCanvas: You can represent each of the keys as CanvasPolylines, fill them with the colors you need. Each of the Canvas items is a GtkWidget, so you can act on events like enter, leave, button-pressed etc.
This method seems to make more sense (to me) than separate DrawingAreas. As each drawn element is still accessible, you can even change colors/size and other properties dynamically. Also, Polyline lets you make more complex shapes.

UISwipeGestureRecgoniser in more than up, down, left and right Swift

For my app I would like to have it so the user can swipe in every direction using the UISwipeGestureRecgoniser. Would it be possible to instead of having just up, down, left and right, but one for ever degree and therefore I can use that to move my sprite in that direction?
UISwipeGestureRecgonizer doesn't have such possibility, it only contains 4 directions
If you want just to move object along with user finger you can try dragging event (UIControlEventTouchDragInside).
Here is nice example how to achieve this: Basic Drag and Drop in iOS

Matlab GUI sliders: Change position directly to clicked point

Does any one know a way to change the behavior of Matlab sliders so that they move directly to the value you click on?
For instance, lets say a slider is initialized at zero (far left side). I'd like to able to click anywhere on the slider (including the far right side) and have the slider instantly move to that location. The way they normally work you'd have to click repeatedly to move the slider over to the right side one increment at a time, or hold down the right arrow.
I am running an experiment where subjects need to assign values for 420 sliders! It would speed things up a lot of each slider only required a single click.
Thanks,

In gamesalad actor moves out of the screen on x-axis

In gamesalad framework I am creating a game in which I have an actor which only moves on x-axis on touch is pressed. But when I move it to x-axis the actor goes away out of the range of the screen. Let me clarify that I am new to gamesalad framework.
plz help to solve the problem.
I'm reading this in two different ways:
1 - when you press your touch controls the actor disappears from the screen
2 - when you press the touch control the actor moves along the x-axis and out of the screen
For the sake of argument I'm going to assume that we're talking about number two.
What you'll need to do is restrict the actors movement to the boundaries of the current screen. You can do this is two ways with Gamesalad
1 - create an invisible barrier for your actor to collide against
2 - use a behaviour to prevent your actor from going beyond the screen boundary
I'll explain both:
1, Invisible barriers
What you'll do is create a new actor, and set it to collide with the actor that your controlling. You'll create a few instances of this actor to create a walled area for your actor. Although this works, it's a little cludgy and using additional actors in a scene take a little performance away from your application.
2, using a behaviour
In my opinion the better way is to use the given behaviours in Gamesalad itself.
To stop the player actor from moving off screen you can use a combination of Rules and the Constrain Attribute behaviour to achieve this.
The first thing to know is your screen size; for an iPad I believe it's 1074 along the x-axis.
So to stop the actor moving off either side of the screen you'll need to do the following:
Open up the player actor
the click on the "Create Rule" button on the top right.
A new rule window will appear, but default the first dropdown will say "Actor receives event" change this to "Attribute".
Next select the attribute to use the rule against, since we're interested in the x-axis we'll want to query that player attribute which will be:
(also known as self) > Position > X
Select the greater than symbol (">") and then enter the maximum width of the screen minus whatever border value you want, so I'll use 1014 (1024 - 10).
Find and drag the Constrain Attribute behaviour into your rule a set the actors X position to 1014.
This will stop the actor from going beyond one side of the screen, now copy the rule and amend the settings to that if the actor goes less than, say 10, it will constrain the actors X position to 10.
I'd post an image, but alas my Karma isn't large enough right now! Hence the large explanation!
Hope this is what you're looking for!
It is way easier than that.
In top of the Gamesalad Creator there is a play button, which you probably know, displays your progress. To the left of this button there is a button that looks like a little video camera, it changes the camera settings. So what you first have to do is click the camera button, then the rectangular camera screen will show itself as marked. In the center of each of the sides of the highlighted rectangular which is the camera screen, sits 1 little grey rectangular. Each of these needs to be pulled to the center of the camera view so that you get a little grey "cross" in the center and from the center to the boarder there will now be this highlighted color.
Second and last step is easy, just go under your character and in (type or drag in a behavior block) you type control camera... or drag the control camera block, which as by the type box is statet possible.
Since Gamesalad only can have one camera at a time, and you character is the only one with the control camera option applied it will follow him and only him. Wherever your character starts on the screen, the camera will follow it when it passes through the center of the screen. You may know this from Super Mario Bros. Where you start of a little to the left and walk right and the second Mario enters the center of the screen, the camera follows him from then on.
Hope this helps... :