Start a new topic
Not Taken

simple text command

at the moment i can print text to the screen with 


xstr 0,0,100,30,1,RED,BLACK,1,1,1,"China"


in this command i must know the size of the text (width and height) so i can give the right values for the box.


Is there, now or in the future, some simple text command like:


str 0,0,RED,BLACK,"China"


or:


str 0,0,RED,"China"





    - you know the length of the string, strlen command

    - you know your font, the character width and the character height

    - what's more easy than calculate the dimensions ....


    - xstr 0,0,stringlength*fontwidth+border, .........

the reason for all the options in xstr is to handle the possibilities


Such str command would have evolved between v0.09 to v0.47


Your simplified str x,y,color,text

 - doesn't state or handle left aligned, centered, right aligned (for number values)

 - doesn't state or handle which font of the 22 fonts contained in project to use

 - doesn't state or handle top aligned, centered, bottom aligned (for multiline)

 - doesn't state or handle styles - image, cropped, solid colors or none

 - doesn't state height or width of text being generated (to crop at limit else overflows)

   etc, etc

It is exactly because of these possibilities the other parameters exist


When such a str command could be made

 - it is under two weeks another says it doesn't handle alignments

 - and another says it doesn't handle backgrounds

 - and another says it doesn't handle multilined

 - and another states it doesn't handle ....


So in only a few weeks such str will be an xstr.once again.


What you suggest for a single user's purpose can be done in code.

 - when you know parameter 2 is desired to be ### - store in variable

 - when you know parameter 3 is desired to be ### - store in variable

 ....

with such stored parameters can be filled by variables


Login or Signup to post a comment