I am working on an application to be used on a windows tablet.
I have been playing around with the gesture manager and i have linked it to my rzComboBox. On the onGesture event of the combo box i have:
if EventInfo.GestureID = sgiDown then
ShowMessage('CB Down')
else if EventInfo.GestureID = sgiUp then
ShowMessage('CB Up');
The problem i am having is it only seems to hit the ShowMessages whenever i make a gesture on the closed combobox and not when i make a gesture on the dropped down part of the combo box.
Any help would be much appreciated
Related
So I'm making a sort of spleef type game where players jump around as blocks disappear beneath them. However, if you just hold down the space bar, Roblox doesn't seem to register the "Touched" event. Can anyone help?
Here is my script for each of the disappearing platforms:
local platform = script.Parent
local function fade()
print("Touched!")
platform.Transparency = 1
platform.CanCollide = false
end
platform.OnTouched:Connect(fade)
A BasePart doesn't have an event named "OnTouched", but I think you are referring to "Touched" event of BasePart.
You can change the platform.OnTouched:Connect(fade) to platform.Touched:Connect(fade)
https://developer.roblox.com/en-us/api-reference/event/BasePart/Touched
With new r15 anthro models, sometimes the touch won't register as the hitbox fails to register a touch.
What I did a long ago was to create an invisible box with no collision that is thin above the part that you would like to touch, then check the .Touched event in the invisible box instead the one you are checking right now.
Hi am making a game for Windows PC using XNA and I want to check when the game window cross "X" is clicked, so I can instead draw a menu and do other stuff instead of the game closing.
So yea, how can I check when the cross is clicked.
Thanks!
There is nothing special needed for XNA, you can do this the same way as you could without it.
In your Initialize or LoadContent method need to find the Windows form reference your game is using, and add a Closing event to it.
Form form = Form.FromHandle(Window.Handle) as Form;
form.FormClosing += OnClosing;
Then using this OnClosing method, you can cancel the close event, and run your own menu screen. (Probably by changing the game state and drawing something else)
void OnClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
ShowMenuScreen();
}
This is pertaining to an image gallery, so as you "swipe", images are loaded and unloaded off of the screen, but the center image always appears smoothly.
It is code derived from the swipeview library described here: http://cubiq.org/swipeview
The problem is that, there is a 100-200ms delay which occurs between when the javascript sets the webkitTransform in the touch end event, and when the element actually starts animating on the screen.
This problematic delay, only happens intermittently; it seems that it starts happening consistently after about 15-20 slides have been unloaded/loaded.
In the touch move event there is code like this:
element.style.webkitTransitionDuration = 0
element.style.webkitTransform = "translate3d( etc. ) "
And this functions very fast, such that if you move your finger around on the ipad, the element follows your finger precisely and "instantly".
And in the touch end event there is code like this:
element.style.webkitTransitionDuration = '<some_number>ms';
element.style.webkitTransform = "translate3d( etc. ) "
And the touch end event is where the problem is. The touch End event itself fires the instant the finger is removed from the ipad, however, when the problem is happening, the css update doesnt trigger an actual animation on screen until after the problematic delay mentioned above.
This was a tricky one. I finally found the culprit. In my touchend event listener, I was calling a function that added classes to DOM elements. This caused Safari to take a moment to rewire textures to the GPU, resulting in the stutter. Removing those direct className updates made it all buttery smooth again (and I'm still using requestAnimationFrame and not CSS transitions).
I moved my className changes to a separate event that fired from touchend instead and it didn't cause any performance issues. So, if you must set classes, just don't do it directly in the touchend callback. Trigger another event instead or set the classes in requestAnimationFrame.
I'm working right now on an iOS project with air. Everything is fine, and I implemented the "swipe" gesture among some others. In the beginning, the gesture was recognized, the event fired, everything alright.
Then I changed something (don't ask me what), and the event isn't any more dispatched.
So my Problem is, if I want to test it, I'll have to compile, then upload to testflightapp.com, then install it. Takes a lot of time.
Is there any possibility to test the gesture on my mac while developing? So I can trace and check what is happening, or what not.
I compile with the Flash IDE CS5.5, but could also with Flash Builder if there is a solution.
And just for your interest, here the interesting part of my code.
Multitouch.inputMode = MultitouchInputMode.GESTURE;
contestView.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipeContest);
function onSwipeContest (e:TransformGestureEvent):void{
if (e.offsetX == 1) {
//User swiped towards right
// do something
}
}
This is a lame answer, but why aren't you skipping the testflight step and just dumping it straight to your phone? do you have xcode installed? if so, fire it up, open the organizer, set your device for development, and have at it. way, way faster that way.
anyway.
are you sure that gesture events aren't functioning on your mac? i've found that multitouch events are spotty, but gesture ones usually work ok on the trackpad from air 2 onward.
I've recently started checking out XNA. All is going well and I've even got a working sample started. One thing that's been bugging me is that whenever I place my mouse over the game window it disappears. I don't know if this is the default behavior but I would like to change this so that I can see my mouse. Any and all advice is appreciated.
Simply set IsMouseVisible to true in your main game class(preferably in your Initialize method or Game class constructor) :
IsMouseVisible = true;