有人可以帮助我吗?
我有一个舞台和图像,我想从输入中更改宽度和高度。这是代码,它不起作用:/帮助我。)
var stage = new Kinetic.Stage({ container: 'containerCreator', width: imageWidth, height: imageHeight });
var layer = new Kinetic.Layer();
var imageObj = new Image();
imageObj.onload = function(){
var yoda = new Kinetic.Image({
x: 0,
y: 0,
image: imageObj,
width: imageWidth,
height: imageHeight
});
layer.add(yoda);
layer.add(vrchnyText);
stage.add(layer);
};
imageObj.src = imageSource;
$('#vrchCreator').keyup(function(){
stage.width = $(this).val();
stage.height= $(this).val();
layer.add(yoda);
stage.add(layer);
});