I want to make drag and drop game in android
at initial stage image is drawn on canvas and at touch event it will move from that position and put at the specific point
what i can do for this? can any one suggest me something
Related
I want to draw some path with user's touch. if users moves finger from one position to another position a path will be drawn exactly as user moved finger.
We can draw a line with by defining color but i want to draw that line with sprite(image).
What I exactly meant is I just want to use image using sprite instead of using color to draw line. is it possible with LibGDX? if yes , how can we do that? and how will I generate image to use as sprite for that?
I do not know what is going on. I am hiding the gesture drawing , rather then this I am planning to show the the drawing drawn by the paint and canvas.I am using the drawing panel class which is working fine if used alone as shown in this question. It is drawing perfectly.
Now what I was thinking and tried is this , I have implemented the gesture overlay view alone and it was working and detecting gesture. But due to some reasons I am manipulating these two methods all together 1.Paint to draw on canvas 2 gesture to recognize user gesture while drawing on Canvas
Now what I am trying and expecting is , When user draw A on canvas the the canvas starting following the user finger and starts drawing but I think as when the gesture overlay starts detecting gesture, it looks like that the touch is passed to gesture overlay view where as the Paint and canvas stops further drawing.
What I want :
I want that the touch event should be received by the canvas and gesture overlay equally , so that they both work independently.
In simple Words , Do you have any idea how to send touch event to both of these equally ?
Ok there it is , I found the solution , if some one also trying to get it , I mean to use Gesture overlay view , while having other child. Just put the following line in the gesture overlay view xml
android:eventsInterceptionEnabled="false"
and it would start working .
I'm developing a finger paint type of application . I want a erase functionality that delete a single full stroke (i don't want point by point or full screen deletion) I want exactly to delete the strokes(a single stroke is points between touch down and touch up). Is there any predefined method in the android canvas do this stroke deletion ?
Keep a list of all the strokes. When you want to delete one, remove it from the list, invalidate your view, and recreate the canvas by walking through the full list of all strokes.
I am using the Multitouch Controller made by Luke Hutchison found here
https://code.google.com/p/android-multitouch-controller/
My problem is this. I can place an image onto the canvas. I can select it, move it, rotate it and scale it perfectly fine. The problem is I also allow the user to move the canvas by translating it on drag. On the screen the images seem to appear in the correct location following the translation of the entire canvas. The problem is trying to select them afterwards.
I don't know if it's an issue with the touch point after the canvas translation not taking into account the new canvas location/offset or the location of the images haven't been updated with the canvas translation. Does anyone have any experience with this or be able to point me in the right direction!?
I'm currently trying to create a circle (via canvas drawing, opengl or drawable) and define 4-5 buttons inside of it. My first thought was to create some drawables (quarters of circles) and overlay them onto the main circle, but then I'll have the touchable zone too large - e.g. in the middle of the main circle.
Is there anyone who tried this and found a decent solution to it?
You could just override onTouch() in your custom View that draws the circle (and other button graphics), and do a bit of simple maths when you get the finger down event to determine whether the user has touched within the circle, and what particular defined zone within the circle.