skewing text menus
i am starting to make alittle text game havent actually done any code
yet but was wondering how do i keep the menu/screen from skewing
when text or numeric values change in size? is it the LOCATE command
the keeps everything straight? or TAB?
like below as en example of a simple menu...
skewed text menus
skewed text menus
Last edited by sid6.7 on Sat Jul 22, 2006 2:01 am, edited 1 time in total.
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
IS this assuming you want the numbers right justified? and you don't want the right vertical line to cut off or offset? (pardon my french, I'm not 100% sure what skewing mean.
But one of the things I do is convert the number to a string with STR$ and add spaces based on the length of that string. (in FB you could use the FORMAT$ statement to format it properly).
Hence if I want a total width of 16 you could do something like:
ResultValue = SPACE$(16 - LEN(StringOfNumber)) + StringOfNumber
This would give something like:
By doing it this way, you don't have to change your locate statement.
Hope this helps.
But one of the things I do is convert the number to a string with STR$ and add spaces based on the length of that string. (in FB you could use the FORMAT$ statement to format it properly).
Hence if I want a total width of 16 you could do something like:
ResultValue = SPACE$(16 - LEN(StringOfNumber)) + StringOfNumber
This would give something like:
Code: Select all
12.32
312.56
1231.43
Hope this helps.
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
oops i guess i said it wrong
no not justification....or
i didnt quite understand your answer...
for example the first item
TEXT: here if it changed to TEXT: bubbasmith
the menu would shove everything to the right to
accomodate the extra new letters then the BARS
of my menu would skew(slide) off screen and wrap
around and all that...
same for the other
if NUMBERS: 1234 changed to 123456789 it would
shove the menu BARS all kitty wompas to the right
cuase the new data is longer then the old....
like this?
or even worse it makes new blanks lines...
no not justification....or
i didnt quite understand your answer...
for example the first item
TEXT: here if it changed to TEXT: bubbasmith
the menu would shove everything to the right to
accomodate the extra new letters then the BARS
of my menu would skew(slide) off screen and wrap
around and all that...
same for the other
if NUMBERS: 1234 changed to 123456789 it would
shove the menu BARS all kitty wompas to the right
cuase the new data is longer then the old....
like this?
or even worse it makes new blanks lines...
well yeah Antoni's correct
i think you are using FreeBasic
But In Qbasic you could have used
ltrim() and Rtrim()
Do they work in freebasic?
and yes..
This is not skewing
if want to know what skewing means just
open paint
Image menu and there is an option called strecth/skew
open it and i am sure you would get the idea....
i think you are using FreeBasic
But In Qbasic you could have used
ltrim() and Rtrim()
Do they work in freebasic?
and yes..
This is not skewing
if want to know what skewing means just
open paint
Image menu and there is an option called strecth/skew
open it and i am sure you would get the idea....
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
From the looks of this, you're using a statement similar tosid6.7 wrote:like this?
Code: Select all
PRINT string$+"| |"