[dali_1.4.26] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / docs / content / resource-image.js
1 /**
2  *
3 ## ResourceImage (extends Image)
4
5 A resource image extends the basic {{#crossLink "image"}}Image class{{/crossLink}} with
6 the ability to load an image from a file.
7
8 ### Simple example
9 ```
10
11 // Create a resource image with a given URL
12 var image = new dali.ResourceImage( {url: "my_image.png"} );
13   
14 // Create a material that specifies the visual properties of the renderer.
15 var material = new dali.Material();
16   
17 // Add the image as texture to be used by the material
18 material.addTexture( image, "sTexture" );
19   
20 ```
21 ### Advanced example
22 ```
23
24 function imageLoaded( image )
25 {
26   log("image loaded " +image.url + "\n");
27 }
28   
29 var image = new dali.ResourceImage( {url: "my_image.png"} );
30   
31 image.on("imageLoadingFinished", finished );
32   
33 // Create a material and add the image as texture to be used by the material.
34 var material = new dali.Material();
35 material.addTexture( image, "sTexture" );
36
37 ```
38 @class ResourceImage
39 @extends Image
40  */