on 20-04-2012 08:57 PM
Well i'm new to using a touch-screen, it's actually quite exciting programming for one
, and i'd really like to in-coroprate quite a few touch screen controls into my game.
However i'm not 100% sure on what the best method would be specifically for what i'd like to capture which is a "flick" gesture, in both the horizontal & vertcial planes. So i'm just wondering what the best method would be to capturing this type of gesture.
Any help is greatly appreciated.
Solved! Go to Solution.
on 22-04-2012 04:44 PM
on 22-04-2012 05:36 PM
on 24-04-2012 10:49 AM
on 04-05-2012 06:08 PM
on 06-05-2012 06:07 PM
Heres a quick example of creating a flick gesture on an ImageBox (UI Toolkit). Listening for other gestures can be done in the similar way.
FlickGestureDetector flick_gd = new FlickGestureDetector();
flick_gd.Direction = FlickDirection.Horizontal;
flick_gd.FlickDetected += delegate(object sender, FlickEventArgs e) {
Console.WriteLine("Flick detected!");
};
ImageBox imagebox = new ImageBox();
// configure imagebox
imagebox.AddGestureDetector(flick_gd);
on 11-06-2012 08:38 PM
Hi James,
DoubleTapGestureDetector doesn't appear to work.
In the simulator it sorta kinda registers a double tap event, on the actual Vita, it doesn't work at all.
on 12-06-2012 02:56 PM
For the record, the end events dont fire on the pinchgesterdetector either.
on 13-06-2012 02:53 PM
Thanks for reporting it. We've been able to replicate the DoubleTapGestureDetector problem on the PS Vita, and we'll investigate this problem.
The end events on the PinchGestureDetector look to be functioning as normal. Do you have a specific example where they do not fire?
Regards,
James
on 13-06-2012 04:31 PM
I haven't actually got my Vita in front of me to test with, but I believe the following code should demonstrate the result:
using System;
using System.Collections.Generic;
using Sce.Pss.Core;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Input;
using Sce.Pss.HighLevel.UI;
namespace PinchExample
{
public class AppMain
{
private static GraphicsContext _graphics;
private static ImageBox _imageBox;
private static PinchGestureDetector _pinchGestureDetector;
public static void Main(string[] args)
{
_graphics = new GraphicsContext();
UISystem.Initialize(_graphics);
Sce.Pss.HighLevel.UI.Panel dialog = new Panel();
dialog.Width = _graphics.GetViewport().Width;
dialog.Height = _graphics.GetViewport().Height;
_imageBox = new Sce.Pss.HighLevel.UI.ImageBox();
_imageBox.Image = new ImageAsset("/Application/image.png");
_imageBox.PivotType = PivotType.MiddleCenter;
_imageBox.Width = _imageBox.Image.Width;
_imageBox.Height = _imageBox.Image.Height;
_imageBox.SetPosition(dialog.Width/2,
dialog.Height/2);
_pinchGestureDetector = new PinchGestureDetector();
_pinchGestureDetector.PinchDetected += delegate(object sender, PinchEventArgs e) {
// I work fine
};
_pinchGestureDetector.PinchEndDetected += delegate(object sender, PinchEventArgs e) {
// I dont
MessageDialog.CreateAndShow(MessageDialogStyle.Ok, "Wont be fired soon",
"Can you hear me now?");
};
_imageBox.AddGestureDetector(_pinchGestureDetector );
dialog.AddChildLast(_imageBox);
Sce.Pss.HighLevel.UI.Scene scene = new Sce.Pss.HighLevel.UI.Scene();
scene.RootWidget.AddChildLast(dialog);
UISystem.SetScene(scene,new SlideTransition(2000.0f,FourWayDirection.Left,Move Target.NextScene,SlideTransitionInterpolator.Linea r));
while(42!=43)
{
_graphics.SetClearColor(255,255,255,0);
_graphics.Clear();
UISystem.Update(Touch.GetData(0));
UISystem.Render();
_graphics.SwapBuffers();
}
}
}
}
The PinchEndDetected event will never be fired.
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870