Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Coordinates
Author Message
Jay316

Posted: Wed Jun 22, 2005 6:36 pm   Post subject: Coordinates

how do i specifically know what part of the screen is which. how do i make a square in the middle or in the top left of the screen in turing? if someone can please help me..thanks!

[Gandalf]

Posted: Wed Jun 22, 2005 6:45 pm   Post subject: (No subject)

Alright, here's the simple way to know generally.

I hope you know from math that x is _ horizontal and y is | vertical. 0x0y is at the bottom left hand corner of the screen. Maximumx and maximumy is top right corner of the screen. We see this when using: maxx and maxy. Try it,
 code: put maxx put maxy

So to find the center of the screen we would divide maxx / 2 and maxy / 2.

Use this program to figure out the coordinates on the screen using the mouse:
 code: var x, y, button : int %vars for the mouse where code loop %needs to be in a loop to keep on reading mouse data     Mouse.Where (x, y, button)    %code to find data on mouse     put " ", x, " ", y     %put mouse location     %check to see if button is hit     if button = 1 then         locatexy (maxx div 2, maxy div 2)         put "you clicked the button"         delay (1000)         cls     end if     cls end loop
Jay316

Posted: Wed Jun 22, 2005 6:54 pm   Post subject: (No subject)

thanks so very much! im gonan try and load this program just before my test
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: