Hi in app inventor is there a way to detect which imagesprite was touched. I want to use the header to set a global index.
Thanks in advance
yes, each image sprite has its own Touched event, for example ImageSprite1:
In the Canvas.Touched event you only can get the information, if an image sprite was touched or not
http://ai2.appinventor.mit.edu/reference/components/animation.html#Canvas
Touched(number x, number y, boolean touchedSprite)
When the user touches the canvas and then immediately lifts finger: provides the (x,y) position of the touch, relative to the
upper left of the canvas. TouchedSprite is true if the same touch also
touched a sprite, and false otherwise.
Related
I am new to iOS development. I'm trying to create an effect like the following figure shows. There is a list of items in a view, When user touch the view, a portion of the view is scaled from the touch center (but the top is aligned). When touch moves, the magnification effect moves as well with a smooth animation.
Look forward to any kind of help. Thanks in advance.
I want to position a button at place having certain pixels distance from left and top. I have the exact position in pixels of where to place the button. But, how can I do so?
Try Absolute layout
https://developer.xamarin.com/guides/xamarin-forms/user-interface/layouts/absolute-layout/
Another option is create view renderer which implement this funcionality in native part.
I am making a watch application for Samsung Gear S2 with EFL Native application.
Problem was happened when I rotate hands of the watch.
Look at following image.
This is normal image I paste it to evas_object and it's not rotated yet.
After I rotate it, the edge of hands has changed to jagged shape like it.
Resolution of gear s2 is 360px X 360px so I make every image is fit to this size.
And I rotate image with following code.
Evas_Map *m = NULL;
m = evas_map_new(4);
//evas_map_smooth_set(m, true);
evas_map_util_points_populate_from_object(m, obj);
evas_map_util_rotate(m, degree, cx, cy);
evas_object_map_set(obj, m);
evas_object_map_enable_set(obj, EINA_TRUE);
evas_map_free(m);
I was try fix it with evas_map_smooth_set() function.
EFL document is written to this setting makes image to "SMOOTH"
and default setting is "true". but I worried tizen change it to "false".
But jagged shape is still showing Despite after I set true or false.
The Watchface that created by "Gear Watch Designer" has not jagged image on rotating there hands.
How I can rotate Image without jagged edge?
OK finally I found why jagged edge is appear on rotating.
In the emulator or my gear s2, default EFL rendering engine is not opengl backend.
So I can fix it with following codes.
elm_config_accel_preference_set("opengl");
Write this code before create window (elm_win_add) it will make anti-aliased image on rotating image.
Sorry for the very late answer, but I believe you can fix this issue in two ways:
Call evas_object_anti_alias_set() on the evas object that is mapped.
As you've mentionned in another answer, use GL acceleration but you may even want to enable MSAA on the backbuffer: elm_config_accel_preference_set("opengl:msaa");
In my React Native application I have some tiles (wrapped in a View for the example) which are half of the full width wide. They act as buttons and slide to the opposite side to open a menu. When I perform a swipe gesture and release the finger before the slide reaches its final position, I want the slide to animate to its final 'opened' position. The animation should start with the last velocity of the touch gesture for a smooth impression.
I implemented different variations but did not find a good solution (You can find my test-component in my GitHub repository). My View has a PanResponder to manage the gesture and to get the velocity. I started to use the Animated library, but the provided methods do not solve my problem. The only method where I can pass a initial velocity for the animation is the decay, but I can't pass a parameter where the animation should stop. With a timing animation I can set a final value, but can not pass a initial velocity (so the animation starts with a velocity of 0 which looks very jumpy). I tried to combine these two methods, but that does not work properly.
On iOS I could use a horizontal ScrollView with pagingEnabled, which shows the desired effect - but then I do not have the feature on Android.
Any ideas how I can solve this problem and show a smooth animation, starting with an initial velocity and ending on a given position, after the touch gestures end?
Thanks for your help!
EDIT I added the link to my last test component...
You can get a close approximation of the velocity by setting the duration of the timing animation
const duration = Math.abs((this.props.MAXDISTANCE - Math.abs(distanceMoved)) / velocity);
MAXDISTANCE is your final position
distanceMoved is the current position (gestureState.dx)
velocity is the current velocity (gestureState.vx)
You can use Animated.decay or Animated.spring to achieve this effect.
I have an animation for humanoid models to simulate climbing. I have been looking for a way to stimulate this animation when the model comes next to the window. I used the triggers to determine where the model is and it worked. However, when I execute the animation, the position of the model is not being updated according to the animation. I am using offmesh links and nav mesh agent and I disable nav mesh agent when the model triggers. How can I use the animation and provide the update simultaneously?
Animation Properties
Thanks in advance.
I don't think the animation should take care of the movement. You should control that somewhere else. You could make the animation climb from y = 0 to 5 but then it won't work if your ladder is at y = 3.
You'd better have a method that is called from the animation using AnimationEvent so that when you trigger the animation, it also triggers a movement of the object upwards/downwards regardless of the current position of the object. It would simply use Translate and disabled input until the animation ends.