Getting Text Width in EDC

Getting Text Width in EDC

BY 09 Sep 2015 Native Application Development

I want to slide text in my application, for that I need to know the width of the text I am setting, So that I can have uniform, text sliding speed for long and short text .

I tried using the Script

script{
    public myX, myY, myW, myH;

    public slide_to_end_anim(val, Float:pos) {
      set_tween_state(PART:”elm.text”, pos, “end”, 0.0, “begin”, 0.0);
   }
 
    public GetTextExtent() {

       new Float:time;
      get_geometry(PART:”elm.text”, myX, myY, myW, myH);

      time = SPEED/myW;

      anim(time, “my_anim”, 1);
    }  
 }

but get_geometry() is giving the width of the text container and not of the text.

Please guide, is there any Embryo API, or any other way, I can get the text width.

Thanks in advance.

 

Written by