Using TextArea with direct draw: way to deal with

Hi everyone!

I recently started programming in Monkey C and I'm trying to create my first Datafield.


I would like to use TextAreas to render text, but at the moment I have 2 doubts:

  1. It seems that the only way to use percentage values ​​for coordinates (X,Y), Width and Height is to use layout.xml and therefore it is not possible to do this with Direct Draw calls: is this correct?
  2. From the Toybox documentation it seems that the only way to use TextArea in Direct Draw is this:

myTextArea = new WatchUi.TextArea({
            :text=>"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
            :color=>Graphics.COLOR_WHITE,
            :font=>[Graphics.FONT_MEDIUM, Graphics.FONT_SMALL, Graphics.FONT_XTINY],
            :locX =>WatchUi.LAYOUT_HALIGN_CENTER,
            :locY=>WatchUi.LAYOUT_VALIGN_CENTER,
            :width=>160,
            :height=>160
        });

And then use the TextArea in this way:

myTextArea.draw(dc);

Now, are there other ways to use TextAreas that don't involve instantiating a variable, like dc.drawText()?

Furthermore, if after instantiating a TextArea I need to change my layout (for example from settings) and therefore use other types of TextArea, do I need to somehow deallocate or delete the old TextAreas that I no longer need?

Thanks in advance for your help and your patience Smiley