X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fdocs%2Fcontent%2Fresource-image.js;h=fb982a0d9c7b890d3302c9a5d55ca47e5e9f1643;hb=90925e62266ce32a326ba2458e9c3d1107244218;hp=618f3cfc0ebbe2905d0acaa97682b9e9d5ff19df;hpb=e8efa9549ccedae5b8377c9eb331aa8392895879;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-script-v8/docs/content/resource-image.js b/plugins/dali-script-v8/docs/content/resource-image.js index 618f3cf..fb982a0 100644 --- a/plugins/dali-script-v8/docs/content/resource-image.js +++ b/plugins/dali-script-v8/docs/content/resource-image.js @@ -5,18 +5,18 @@ A resource image extends the basic {{#crossLink "image"}}Image class{{/crossLink}} with the ability to load an image from a file. -ResourceImage supports two types of load policies - -- dali.IMAGE_LOAD_POLICY_IMMEDIATE // load image once it is created (default) -- dali.IMAGE_LOAD_POLICY_ON_DEMAND // delay loading until the image is being used (a related actor is added to Stage) - ### Simple example ``` -var image = new dali.ResourceImage( { url:"my_image.png" } ); - -var imageActor = new dali.ImageActor( image ); - +// Create a resource image with a given URL +var image = new dali.ResourceImage( {url: "my_image.png"} ); + +// Create a material that specifies the visual properties of the renderer. +var material = new dali.Material(); + +// Add the image as texture to be used by the material +material.addTexture( image, "sTexture" ); + ``` ### Advanced example ``` @@ -25,19 +25,16 @@ function imageLoaded( image ) { log("image loaded " +image.url + "\n"); } - -var options = { - url:"my_image.png", - loadPolicy:dali.IMAGE_LOAD_POLICY_IMMEDIATE, - releasePolicy: dali.IMAGE_RELEASE_POLICY_UNUSED -} -var image = new dali.ResourceImage( options ); - -image.connect("image-loading-finished", finished ); - -var imageActor = new dali.ImageActor( image ); + +var image = new dali.ResourceImage( {url: "my_image.png"} ); + +image.on("imageLoadingFinished", finished ); + +// Create a material and add the image as texture to be used by the material. +var material = new dali.Material(); +material.addTexture( image, "sTexture" ); ``` @class ResourceImage @extends Image - */ \ No newline at end of file + */