Text in Kinetic js

<html>
<body>
<div id=”ok”></div>
<script src=”http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v5.0.1.min.js”></script&gt;
<script defer=”defer”>
var stage=new Kinetic.Stage({
container:’ok’,
width:500,
height:500
});
var layer=new Kinetic.Layer();
var st=new Kinetic.Text({
x:stage.width()/2,
y:15,
text:’simpe text’,
fontSize:19,
fontFamily: ‘Calibri’,
fill: ‘green’
});
st.offsetX(st.width()/2);
var ct=new Kinetic.Text({
x: 100,
y: 60,
text: ‘COMPLEX TEXT\n\nAll the world\’s a stage, and all the men and women merely players. They have their exits and their entrances.’,
fontSize: 18,
fontFamily: ‘Calibri’,
fill: ‘#555’,
width: 380,
padding: 20,
align: ‘center’
});
layer.add(st);
layer.add(ct);

stage.add(layer);
</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