Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 locatexy??
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chopperdudes




PostPosted: Mon Dec 01, 2008 6:08 pm   Post subject: locatexy??

I have a simple question, does locatexy locate by the actual pixel xy cordinates? or does it simply locate the row/column the xy cordinate is in?!

from the looks of a simple program, it does the latter:

Turing:

var x, y, z : int
loop
mousewhere(x, y, z)
locatexy (x, y)
put "hello world"
end loop


is that supposed to be the case? is there any way (without Font.Draw) i can locate text by true cordinates?
thx
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Mon Dec 01, 2008 6:10 pm   Post subject: RE:locatexy??

First question, from the sample code, obviously it locates by the actual pixel xy coordinates. Second question, I'm not sure what you mean.
andrew.




PostPosted: Mon Dec 01, 2008 6:17 pm   Post subject: RE:locatexy??

CodeMonkey is half right. It does locate by the pixel coordinates, but no exactly on the pixel, it finds the closest column/row and writes there. If you want the actual pixel coordinates for text, you have to use draw text.
CodeMonkey2000




PostPosted: Mon Dec 01, 2008 6:31 pm   Post subject: RE:locatexy??

Hmm, I didn't copy and paste what he said properly, Razz. Why don't you want to use the font/draw procedures?
chopperdudes




PostPosted: Tue Dec 02, 2008 12:17 am   Post subject: RE:locatexy??

yeah that's what i thought

I have to teach my class "advance graphics" in 20-ish minutes, i'm covering View.Set => which includes offscreenonly which is very important for "advance grpahics", animation, the Pic module, and also real life application (aka graphs)...

so i want to label the y axis, but this proves to be difficult cuz locatexy only does so to the nearest column/row.

and font.draw would be too time consuming to even briefly go over.
andrew.




PostPosted: Tue Dec 02, 2008 5:30 pm   Post subject: RE:locatexy??

I guess your class is done by now, but Font.Draw is not that hard to explain. Just explain that Font.Draw allows you to use any font in your Turing program. And explain to use it, you have to make an integer variable. For the value of the variable, you put Font.New ("Font Name:Size"). When you want to draw the font you use Font.Draw ("Text", x, y, font, colour). That's really the basics of Font.Draw.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: