How can I animate a Marker when I put it on the map? - android-maps-v2

I would like to add a small animation to my markers when I put them on the map.
Just in the moment when I call:
Marker marker = mMap.addMarker(...);
Something like a small bounce or similar during half second or so.
I don't find the way to get the Marker's view.
If I find the way to get the view, I guess it is easy to apply an animation using View.setAnimation() and res/animator/marker_animation.xml
Any help or suggestions?

There is this good video that shows markers animations: https://www.youtube.com/watch?v=WKfZsCKSXVQ
You can't animate the "Marker View" itself because it not accessible

Related

RaphaelJS Multiple animate same element

I currently have the following working fiddle
var moveAnim = Raphael.animation({ progress: 1 }, 5000, 'bounce').repeat(Infinity);
I animate a circle along a line.
I also want to make the circle flash at the same time but I can't seem to work out a way to do this?
I thought about adding the circle to a set and applying the additional animation to this but I can't see to get this either!
Any ideas?
This is a hack and I make no attempt to hide it, but it could be made a bit nicer.
There's a couple of problems depending on 'how' you want to animate the flash. The main problem is having 2 simultaneous animation on the same object, as Raphael doesn't do this (to my knowledge). Its easier if you want to animate an alternate attribute than the same one. If you want to animate a scale to indicate a flash, you will need to append the scale transform to the end of the path transform string ('t,s').
Example here, just uses opacity attribute.
Probably the nicest method would be to include something that figures out time running and amends an attribute manually within the animation function (paper.customAttributes.progress). However, that will probably take a bit longer.
Another alternative could be to animate another object off screen, that does all the calculations for you. It feels a bit ugly, but should work.
So earlier we create a dummy object off screen...
var dummy = paper.circle(-100,-100,10).attr({ opacity: 0 });
Within the progress func, you can then set the real circles opacity to be the same as the offscreen one.
this.attr('opacity', dummy.attr('opacity'));
And we get the dummy animation triggering later
dummy.animate(flashingAnim);
jsfiddle
As mentioned, I think there are cleaner ways, but may involve you writing a small linear animation func separately, but this may help if performance isn't an issue and you don't mind extra elements in the dom.
An alternative solution that I came up with is a looping callback. The very sound of a looping callback sounds ugly but I guess thats what an animation is?
It does appear that you can attach multiple animations to an element! Here's a an example
function animateIn() {
flashingCircle.animate({ fill: '#f00' }, 1000, animateOut);
}
function animateOut() {
flashingCircle.animate({ fill: '#fff' }, 1000, animateIn);
}
animateIn();

Issue related to draggable content in famo.us

I have small application in famo.us framework. There are 5 images. I want drag images. requirement is like when i drag firstImage, second image should be visible behind the first image. i tried to show second image on dragging up of firstImage, but it hides firstimage.
so is it possible to show second image behind the first image ??
Thanks
Check the z position of your images. Chances are you're encountering z-fighting, where two elements exist on the same position on the same z-axis. Try changing the z-index of the images to different values first to see if that fixes it.
Otherwise, check the 3d-transform you've supplied to famous to make sure your images aren't resting on the same z-value.

How do I draw a line on a Lazarus form?

I often use a TPanel or TGroupBox to group my form controls.
Now I need to draw just a straight line like the border of a Panel or GroupBox.
How do I do this on LAZARUS?
Thanks in advance!
Note: The technique must work on both Linux and Windows
As an optical line separator you should use either the TBevel component with Shape property set to one of the following values bsTopLine, bsBottomLine, bsLeftLine or bsRightLine depending on which line you currently need and resize it to a smaller size (in your case you can use bsTopLine or bsBottomLine and resize the bevel vertically):
Or you can use a special component called TDividerBevel which except the single line adds to this optical divider also a caption:
Here's what I've finally done but I'm not sure if this is the RIGHT way so I won't accept my answer. If there's someone else who can point out any issues with this, please let me know. I found this pretty straightforward as well :)
Place a TGroupBox on the form.
Leave the Caption property blank. Now it should look like a panel with only borders.
Use the mouse and drag the bottom border towards the top. Now it looks like a line.
Well, I personally think this method is NOT efficient as it would take up more memory space than just a real straight line. Anyway, so far it seems to work for me :)
Here's the screenshot - look towards the bottom (just above the last text box). The only issues is that on the sides of the line, it shows the lines bending. I think I should set the properties correctly than dragging with the mouse.

What's is the best and common way of adding a grid to a Cocos2D game

I need to add a grid to the background of a game. It should be both zoomable and I should be able to know at which square I am drawing another object now. I need something like this:
What's the most common and proper way of doing this?
Use tileMap(CCTMXTiledMap) inside CCLayerPanZoom. Its easy to track grid clicked and easy to zoom.

what's the best way to display images in qt? also I would like to zoom in to particular areas as well

I've been using label to display images. I'd like to be able to click and create a bounding box then be able to drag the cursor to move around in the image. What would I need to do this? Thanks.
I'm not 100% sure I understand what you are trying to do, but I think the QGraphicsScene is what you are looking for. You can (among many other things):
Render images (QGraphicsPixmapItem, for example)
Change the zoom level when rendering the scene on a QGraphicsView.
Select things using a "rubber band"
Move items around with the mouse (see QGraphicsItem::ItemIsMovable)
etc.
You may need to get familiar with Qt's graphics view framework.