语言

Menu
Sites
Language
Inline image and text ind EDC

I had created edc file which contains image and text (inline). But when the text is longer it expands in both directions. I tried making it expand only to the right - but without success.

 

I tried creating horizontal box with image but the image was not working.

 

Explanation of what I want to achieve:

[Img]     short text

[Img]     little longer text 

 

What I currently have:

[Img]     short text

[Img] little longer text

 

my edc file:

collections
{
   base_scale: 1.0;
   group 
   {
      name: "horizontal_image_text";
      parts 
      {
         part 
         {
            name: "image";
            type: SWALLOW;
            description 
            {
               state: "default";
               fixed: 1 1;
               align: 0.0 0.0;
            }
         }
         part
         { 
            name: "text";
            type: TEXT;
            description 
            { 
               state: "default";
               fixed: 1 1;
               rel1.to: "image";
               rel2.to: "image";
               rel1.relative: 1.0 0.5;
               rel2.relative: 4.0 0.5;
               text 
               {
                  font: "Tizen:style=Regular";
                  size: 35;
                  min : 1 1;
               }
               color: 255 255 255 255;
            }
         }        
      }
   }
}

 

响应

3 回复
GEUNSOO KIM

did you ever give "align" property to "text" part?
 

Armaan-Ul- Islam

I'm just extending GEUNSOO KIM's reply. Use align (x axis,y axis) property in your text:

text
    {
      text: "Image Description";
      font:"Sans,Edje-Vera";
      size: 25;
      min: 1 1;

      align: 0.25 0.0;
     }

Screenshot:

http://imgur.com/FKheSOV

 

Carsten Haitzler

A nice demo that will even keep aspect ratio of the image to be 1.0 (width/height) with vertical size being the driver for it, with text offset by 40 pixels from the image to the right... left aligned.... replace IMAGE with SWALLOW and remove image.normal line to go back to a swallow, remove the default hello world text. use any image you like and copy it to x.jpg as a test:

collections { group { name: "x";
  images.image: "x.jpg" LOSSY 80;
  parts {
    part { name: "image"; type: IMAGE;
      description { state: "default" 0.0;
        image.normal: "x.jpg";
        aspect: 1.0 1.0;
        aspect_preference: VERTICAL;
        min: 32 32;
        align: 0.0 0.5;
        rel2.relative: 0.0 1.0;
      }
    }
    part { name: "text"; type: TEXT;
      description { state: "default" 0.0;
        color: 255 128 0 255;
        rel1.to: "image";
        rel1.relative: 1.0 0.0;
        rel1.offset: 40 0;
        text { font: "Sans"; size: 35;
          text: "Hello world";
          align: 0.0 0.5;
          min: 1 1;
        }
      }
    }
  }
} }

 

http://www.enlightenment.org/ss/e-58a91be3a5fb45.79908009.png

Play with it. resize it... and see. :)