Image in Kinetic.js

<html>
<body>
<div id=”ok”></div>
<script type=”text/javascript” src=”Kinetic.js”></script>
<script defer=”defer”>
var stage=new Kinetic.Stage({
container:’ok’,
width:500,
height:500
});
var layer=new Kinetic.Layer();
var imageObj=new Image();
imageObj.onload=function(){
var yoda=new Kinetic.Image({
x:200,
y:100,
image:imageObj,
width:106,
height:118
});
layer.add(yoda);
stage.add(layer);
};
imageObj.src = ‘http://www.html5canvastutorials.com/demos/assets/yoda.jpg&#8217;;
</script>
</body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s