Search Results

Search found 233 results on 10 pages for 'pan tian'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

    - by Roar Skullestad
    I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the x and y coordinates that is sent to pan is "jumping", and in an increasingly amount the longer it is dragged. These are an example of the deltaY coordinates sent to pan when dragging smoothly downwards: 1.1156368 -0.13125038 -1.0500145 0.98439217 -1.0500202 0.91877174 -0.984396 0.9187679 -0.98439026 0.9187641 -0.13125038 This is how I move the camera: public void pan (InputEvent event, float x, float y, float deltaX, float deltaY) { cam.translate(-deltaX, -deltaY); I have been using both the delta values sent to pan and the real position values, but similar results. And since it is the coordinates that are wrong, it doesn't matter whether I move the board itself or the camera. What could the cause be for this and what is the solution? When I move camera only half the delta-values, it moves smoothly but only at half the speed of the mouse pointer: cam.translate(-deltaX / 2, -deltaY / 2); It seems like the moving of camera or board affects the mouse input coordinates. How can I drag at "mouse speed" and still get smooth movements? (This question was also posted on stackoverflow: http://stackoverflow.com/questions/20693020/libgdx-actorgesturelistener-pan-parameters-not-moving-actor-in-smooth-line)

    Read the article

  • Implementing `fling` logic without pan gesture recognizers

    - by KDiTraglia
    So I am trying to port over a simple game that I originally wrote to iphone into cocos2d-x. I've hit a minor bump however in implementing simple 'fling' logic I had in the iphone version that is difficult to port over to the c++. In iOS I could get the velocity of a pan gesture very easily: CGPoint velocity = [recognizer velocityInView:recognizer.view]; However now I basically only know where the touch began, where the touch ended, and all the touches that are logged in between. For now I logged all the pts onto a stack then pulled the last point and the 6th to last point (seemed to work the best), find the difference between those pts multiply by a constant and use that as the velocity. It works relatively well, but I'm wondering if anyone else has any better algorithms, when given a bunch of touch pts, to figure out a new speed upon releasing an object that feels natural (Note speed in my game is just a constant x and y, there's no drag or spin or anything tricky like that). Bonus points if anyone has figured out how to get pan gestures into the newest version (3.0 alpha) of cocos2d-x without losing ability to build cross platform.

    Read the article

  • MBP Bluetooth PAN connection with iPhone 4

    - by Chetan Sachdev
    I am trying to share MBP(OSX 10.8.3) internet connection with iPhone 4 (iOS 6) using Bluetooth PAN(Personal Area Network). Problem is Bluetooth PAN is not getting an ip address. I have tried to renew DHCP lease but nothing works. When I give a Manual IP address, the Bluetooth PAN goes green but doesn't shows the connection in iPhone. Is it possible to share the internet connection via Bluetooth. Note: I don't want to create an Ad-hoc connection over wifi.

    Read the article

  • android: How to apply pinch zoom and pan to 2D GLSurfaceView

    - by mak_just4anything
    I want to apply pinch zoom and panning effect on GLSurfaceView. It is Image editor, so It would not be 3D object. I tried to implement using these following links: https://groups.google.com/forum/#!topic/android-developers/EVNRDNInVRU Want to apply pinch and zoom to GLSurfaceView(3d Object) http://www.learnopengles.com/android-lesson-one-getting-started/ These all are links for 3D object rendering. I can not use ImageView as I need to work out with OpenGL so, had to implement it on GLSurfaceView. Suggest me or any reference links are there for such implementation. **I need it for 2D only.

    Read the article

  • UIView Disappears after pan gesture

    - by JulianF
    I am using the following handler for a IUPanGesture. However when the pan ends, the UIView that it is moving disappears. Do I need to add anything else to this code? - (void)pan:(UIPanGestureRecognizer *)gesture { if ((gesture.state == UIGestureRecognizerStateChanged) || (gesture.state == UIGestureRecognizerStateEnded)) { CGPoint location = [gesture locationInView:[self superview]]; [self setCenter:location]; } }

    Read the article

  • Image control with pan and zoom ability

    - by corvus
    I am looking for a free .net winforms control which is able to display images. PictureBox isn't a solution because you have to implement all pan&zoom events yourself. The control should be able to display images like 4000x5000 pixels, have zoom and pan buttons.

    Read the article

  • C# - Pan cursor

    - by Ash
    I'm implementing panning of a large image in a PictureBox control, and I have no problem setting the appropriate directional pan cursors. However, I can't seem to find the image used for the origin of the pan (a circle with arrows inside of it). Where can I find it?

    Read the article

  • Tap, Pan for a map & fixed headers - event conflict

    - by kaiser
    I'm currently developing a small WebApp that makes use of Google Maps (front-end uses jquery-ui-maps) jQuery Mobile with a fixed header & footer Now I encountered a conflict that appears on touch enabled devices as well as on desktop/mouse controlled "click" events: When I "tap" or "click" the map to actually "pan" it, then my header/footer toggles it's visibility. As I want to keep the toggle behaviour, I can't simply deactivate it, but showing/hiding the header/footer on every "pan" of the map is odd. After thinking some time about it, I think I got a concept that should work: Question: How I can I add a delay to the visibility toggle for the header/footer? So when I don't release the finger/mouse after XYms, the header/footer doesn't show/hide? Example: jQuery( '#map_page' ).live( "pageinit" ,function() { // Att.: pseudo code if ( $.mobile.taphold ) don't toggle fixed if ( mousedown > XYms ) don't toggle fixed } ); Thanks!

    Read the article

  • Creating zoom-pan video from a picture in Linux

    - by Pavel
    I would like to make a six second video using six images. Each second is sliding over one image from its top to its botom. Or some other motion effect – I would like to try several. I tried kdenlive Imagination Videoporama PhotoFilmStrip The first one has not enough settings (don't remember what exactly) and all those have rather poor quality – the resized picture is very "aliased" (like no quadratic filter was applied during resizing).

    Read the article

  • Zoom , pan inside a rectangle bound

    - by spark03
    I am building a site with some features of google map. I want to pan, zoom in out a map with tweening effect. But when I zoom the map(Movie clip) it zooms out of the rectangular boundary. I also want to wrap the map(when scrolled). How can I do all these?

    Read the article

  • WPF - Pan & Zoom Image

    - by Yuval Peled
    I want to create a simple image viewer in WPF that will enable the user to: Pan (by mouse dragging the image). Zoom (with a slider). Show overlays (rectangle selection for example). Show original image (with scroll bars if needed). Can you explain how to do it? I didn't find a good sample on the web. Should I use ViewBox? Or ImageBrush? Do I need ScrollViewer? Thanks!

    Read the article

  • Pan point on Google Map to specific pixel position on screen (API v3)

    - by Jake
    When overlay is a Google maps overlay and offsetx, offsety is the pixel distance from the maps center that I want to pan latlong to, the following works. var projection = overlay.getProjection(); var pxlocation = projection.fromLatLngToContainerPixel(latlong); map.panTo(projection.fromContainerPixelToLatLng(new google.maps.Point(pxlocation.x+offsetx,pxlocation.y+offsety))); However, I don't always have an overlay on the map and map.getProjection() returns a projection, not a MapCanvasProjection which does not have the methods I need. Is there a way to do this without making an overlay specificaly for it?

    Read the article

  • OpenLayers .containsPoint after pan

    - by Adrian
    I've seem to have hit a bug or i have overlooked something. I written some code that enumerates through all the vector features on a OpenLayers Vector layer - to check if the mouse is inside a vector feature - if so then it displays some info based on the feature. I had to write my own methods to do this because the existing OpenLayers Controls( select etc) stop after finding a feature under the mouse, and i the possibility of several features being stacked on top of one another. My problem is that the .containsPoint method seems to be using coords from before a 'pan'. After zooming in or out the geometry seems to be in the right place and .containsPoint is works correctly when I wave the mouse over the map. Do I need to do something after the map has been panned to update something( feature's geometry)

    Read the article

  • Best way to pan & scan images with jquery

    - by guy
    Hello, I am trying to make an image pan & scan system. I have a slider that zooms the image (that can be dragged) and also a small map in the corner of the image (that can also be dragged). You can see a rough example here (sorry, I am not allowed to use the design, so it's not formatted): http://lighe.madetokill.com/test/test.html My problem is that although it works great in firefox and opera, it stutters in chrome, safari and IE (it doesn't currently work in IE) at any zoom level except 100% (at 100% it's butter smooth). What is the reason for webkit's poor performance? Am I implementing this wrong? I am basically changing the margin-left and margin-top properties of the image. I know this is fast enough since at 100% it's perfectly smooth. Would I be better off using canvas? I am trying to avoid flash (or any other plugins) if possible. Also please note this is work in progress, there are other bugs except this, so do not bother with those :) Thanks in advance!

    Read the article

  • drag to pan on an UserControl

    - by Matías
    Hello, I'm trying to build my own "PictureBox like" control adding some functionalities. For example, I want to be able to pan over a big image by simply clicking and dragging with the mouse. The problem seems to be on my OnMouseMove method. If I use the following code I get the drag speed and precision I want, but of course, when I release the mouse button and try to drag again the image is restored to its original position. using System.Drawing; using System.Windows.Forms; namespace Testing { public partial class ScrollablePictureBox : UserControl { private Image image; private bool centerImage; public Image Image { get { return image; } set { image = value; Invalidate(); } } public bool CenterImage { get { return centerImage; } set { centerImage = value; Invalidate(); } } public ScrollablePictureBox() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); Image = null; AutoScroll = true; AutoScrollMinSize = new Size(0, 0); } private Point clickPosition; private Point scrollPosition; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); clickPosition.X = e.X; clickPosition.Y = e.Y; } protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (e.Button == MouseButtons.Left) { scrollPosition.X = clickPosition.X - e.X; scrollPosition.Y = clickPosition.Y - e.Y; AutoScrollPosition = scrollPosition; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.FillRectangle(new Pen(BackColor).Brush, 0, 0, e.ClipRectangle.Width, e.ClipRectangle.Height); if (Image == null) return; int centeredX = AutoScrollPosition.X; int centeredY = AutoScrollPosition.Y; if (CenterImage) { //Something not relevant } AutoScrollMinSize = new Size(Image.Width, Image.Height); e.Graphics.DrawImage(Image, new RectangleF(centeredX, centeredY, Image.Width, Image.Height)); } } } But if I modify my OnMouseMove method to look like this: protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (e.Button == MouseButtons.Left) { scrollPosition.X += clickPosition.X - e.X; scrollPosition.Y += clickPosition.Y - e.Y; AutoScrollPosition = scrollPosition; } } ... you will see that the dragging is not smooth as before, and sometimes behaves weird (like with lag or something). What am I doing wrong? I've also tried removing all "base" calls on a desperate movement to solve this issue, haha, but again, it didn't work. Thanks for your time.

    Read the article

  • VEMap Pan triggers VEMap.onclick

    - by Jason
    I'm using the Virtual Earth (or Bing!...) SDK and need to attach an event when someone clicks the map. Unfortunately panning the map also triggers the onclick event. Does anyone know of a work around? function GetMap(){ map = new VEMap('dvMap'); map.LoadMap(new VELatLong(35.576916524038616,-80.9410858154297), 11, 'h',false); mapIsInit = true; map.AttachEvent('onclick', MapClick); } function MapClick(e){ var clickPnt = map.PixelToLatLong(new VEPixel(e.mapX,e.mapY)); Message('Map X: ' + clickPnt.Longitude + '\nMap Y: ' + clickPnt.Latitude + '\nZoom: ' + e.zoomLevel); }

    Read the article

  • remote desktop client with panning of large desktops?

    - by mikewse
    When using the standard Windows remote desktop client to connect to a large remote desktop, the result is usually that the remote desktop is resized to a smaller size matching the local display. Are there any RDP clients that instead leave the remote desktop at its original size and pan this larger area when the mouse reaches the border edges of the local display? Thanks Mike

    Read the article

  • Can someone explain how this IOS Pan Gesture Recognition works? [on hold]

    - by user79894
    It is ios app using Pan Gesture Recognizer It works great, but I didn't get it. I wanna do some changes if the dragged UIView reaches a specific position it would call another method. Any comments are appreciated. - (IBAction)handlePan1:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; /* [x1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.x]]; [y1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.y]]; [x2 setText:[NSString stringWithFormat: @"%.2f", translation.x]]; [y2 setText:[NSString stringWithFormat: @"%.2f", translation.y]];*/ }

    Read the article

  • Android: Easiest way to make a WebView display a Bitmap?

    - by legr3c
    I have some images that I loaded from a remote source stored in Bitmap variables and I want to display them. In addition to switching between these images the user should also be able to zoom and pan them. My first idea was to somehow pass them via an intent to the built-in gallery application but this doesn't seem to be possible. A solution that is suggested in several places is using a WebView since it already supports zooming and panning. My question is how does my Bitmap data get into the WebView? Do I have to write it to a file first, which I would have to remove again later, or is there an easier way? Or are there even better ways to accomplish my main goal, which is displaying Bitmap data as zoomable and panable images?

    Read the article

  • Invalid Argument Error in Jquery gzoom plugin

    - by meandcat
    I am using a Jquery plugin named Jquery gzoom. It's very nice script but when I test it in IE. The script show the Invalid Argument Error. The error only shows in IE. I am wondering if anyone can figure about where in the script cause the error. Plugin page: http://lab.gianiaz.com/jquery/gzoom/index_it.html Thanks in advance.

    Read the article

  • How do I pan the contents of a div when the right mouse button is dragged?

    - by Shaunwithanau
    I need a cross browser way of capturing the right mouse click, preventing the default context menu and making it where when the user drags the mouse they can pan the contents of a div. This is largely similar to Google maps in that they will grip the contents and drag to see what they want. No external libraries please. I am already capturing the events, and know that this will prevent default actions: if (evt.preventDefault) { evt.preventDefault(); } else { evt.returnValue = false; } But this doesn't prevent the context menu AFAIK. Edit: I really am unsure about how to prevent the context menu and what the best way to manipulate the scroll bars would be? examples would be great

    Read the article

  • merging video and audio with custom panning

    - by cherouvim
    I have: a video which has mono audio inside a audio (mono) I'd like to merge those two to a single video file containing: video from #1 audio from #1 full left pan + audio #2 full right pan Is this possible in ffmpeg using 1 command? I've tried the following which almost does this but the video/audio gets out of sync: ffmpeg -i video.mp4 -filter_complex "amovie=audio.wav [r] ; [r] amerge" output.mp4 -y I've managed to do it with multiple commands: #1 create right panned audio ffmpeg -i audio.wav -ac 2 -vbr 5 audio-stereo.mp3 -y ffmpeg -i audio-stereo.mp3 -af pan=stereo:c1=c1 audio-right.mp3 -y #2 create left panned video ffmpeg -i video.mp4 -af pan=stereo:c0=c0 video-left.mp4 -y #3 merge the two ffmpeg -i video-left.mp4 -i audio-right.mp3 -filter_complex "amix=inputs=2" video-mixed.mp4 -y It does the job, but is it possible with 1 command?

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >