Skip to content

Instantly share code, notes, and snippets.

@endtwist
Created May 23, 2012 15:06
Show Gist options
  • Save endtwist/2775779 to your computer and use it in GitHub Desktop.
Save endtwist/2775779 to your computer and use it in GitHub Desktop.
Animated Google Hangout Overlay
// Create a “marker” overlay.
var markerImage = gapi.hangout.av.effects.createImageResource( 'https://donuthorns.appspot.com/static/x.png' )
, marker = markerImage.createOverlay( {
scale: {
magnitude: 0.25
, reference: gapi.hangout.av.effects.ScaleReference.HEIGHT
}
} );
marker.setVisible( true );
// Move the marker back and forth horizontally
var posX = 0, direction = 1;
setInterval( function() {
if( posX <= -0.5 || posX >= 0.5 ) {
direction = -direction;
}
posX += direction * 0.1;
marker.setPosition( posX, 0 );
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment