Author |
Topic: convert coords text ,,graphic (Read 457 times) |
|
leslie griffin
Guest
|
 |
convert coords text ,,graphic
« Thread started on: Jan 27th, 2010, 9:49pm » |
|
mode 14 rem 160,,x,,64...1280..x..1024.........2560.. x..2048 print 2560/160 rem chr x = 16 graph units print 2048/64 rem chr y = 32 graph units rem graphic 0,0 is bottom left of screnn rem text 0,0 is top left of screen brains gone numb anyone got a simple formula for converting text to graphic co-ords and vice versa, I tend to use mode 14 alot as detailed above......thx
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: convert coords text ,,graphic
« Reply #1 on: Jan 27th, 2010, 10:18pm » |
|
Quote:anyone got a simple formula for converting text to graphic co-ords and vice versa |
|
If you're trying to align text and graphics you probably should be using the VDU 5 (write text at graphics cursor) mode, so you can use the same coordinate system for both.
Failing that you can find conversion functions between BBC BASIC graphics units and Windows pixel units here:
http://bb4w.wikispaces.com/Converting+graphics+coordinates
You may be able to use those to convert to text coordinates by dividing by the character width and height values (@vdu%!216 and @vdu%!220).
Richard.
|
|
Logged
|
|
|
|
leslie griffin
Guest
|
 |
Re: convert coords text ,,graphic
« Reply #2 on: Jan 27th, 2010, 10:40pm » |
|
thx for the reply and help.....much appreciated.
leslie griffin.
|
|
Logged
|
|
|
|
|