0
我没有找到我想要的文章
我想知道我的问题的答案。询问“image kinetic.js”
我想点击按钮的左侧。
将图像显示在右边。
var stage = new Kinetic.Stage({
\t container: 'container',
\t width: 530,
\t height: 530
});
var layer = new Kinetic.Layer();
var bg = new Kinetic.Image({
x: 0,
y: 0,
width: 530,
height: 530,
fill: '#D7D7D7',
});
/****************** image **********************/
var imageObj = new Image();
imageObj.onload = function() {
\t var sticker = new Kinetic.Image({
\t \t x: 280,
\t \t y: 300,
\t \t image: imageObj,
\t \t draggable: true
\t });
\t layer.add(sticker);
};
imageObj.src = 'http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png';
/****************** image **********************/
layer.add(bg);
stage.add(layer);
<script src="http://stats4dev.com/stata/kinetic-v5.0.2.min.js"></script>
<div id="container"></div>
<input type="button" value="sticker1">
<input type="button" value="sticker2">
<input type="button" value="sticker3">
<input type="button" value="sticker4">
<input type="button" value="sticker5">
<input type="button" value="sticker6">
坦克你了 – nunabi