Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
   var stage = new Kinetic.Stage({
    container: 'container',
    width: 490,
    height: 300,
  });
  var layer = new Kinetic.Layer();

I want to make a default image to a stage to be the background of the stage. i'm using kineticjs .

share|improve this question
    
I have no experience with Kinetic, but to help others answer: What have you tried? What's a "default image"? –  Anko Jan 3 '13 at 0:57
    
my default image in 490*300 i add it using css but i don't want that i want to draw on the stage using kinetic –  Mohamed Hassan Jan 3 '13 at 9:46
add comment

1 Answer

There are two ways to do this: 1. Assign a background image to the div container using CSS. 2. Create a background layer and add an image that takes up the whole layer.

An example of (2) might be:

var background = new Kinetic.Layer();
var bgImage = new Kinetic.Image(...);

layer.add(bgImage);
stage.add(layer);
share|improve this answer
    
Thanks, Done it's helpful :) –  Mohamed Hassan Jan 4 '13 at 13:09
    
stagetoJson_problem I have a problem also in this one. –  Mohamed Hassan Jan 4 '13 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.