Created
May 23, 2012 15:06
-
-
Save endtwist/2775779 to your computer and use it in GitHub Desktop.
Animated Google Hangout Overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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