Text with user-defined LineGap

  ... the case you feel the need for a new feature or want to submit one.

Text with user-defined LineGap

Postby drderico » Mon Nov 15, 2010 10:47 am

I'd like to be able to set my own LineGap value for Text entity. May be add a new method that creates Text with "float LineGap" parameter.

For example:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package org.anddev.andengine.entity.text;
  2. ...
  3. public class Text extends RectangularShape {
  4. // ===========================================================
  5. // Fields
  6. // ===========================================================
  7. ...
  8. private float mLineGap = 0;
  9. ...
  10. // ===========================================================
  11. // Constructors
  12. // ===========================================================
  13.  
  14. //Here add methods with "final float LineGap" parameter
  15. ...
  16. protected void updateText(final String pText) {
  17. ...
  18. if (mLineGap == 0) {
  19. super.mHeight = lineCount * font.getLineHeight() + (lineCount - 1) * font.getLineGap();
  20. } else {
  21. super.mHeight = lineCount * font.getLineHeight() + (lineCount - 1) * mLineGap;
  22. }
  23. ...
  24. }
  25. ...
  26. }
  27.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


Thanks
drderico
 
Posts: 52
Joined: Tue Sep 28, 2010 8:54 pm
Location: Russia

Return to Features

Who is online

Users browsing this forum: No registered users and 4 guests