Is there a way determine the size and location of an object in graphics mode? My primary interest in placing text objects, field objects, and geometric shapes in relative positions to each other. I didnt see how this might be done in the documentation.
The following is an example of what I am trying to do. The GET commands I used are (believed to be imaginary and) meant to help illustrate what I am trying to do. The intent of the following code is to capture the height, width, X, and Y properties of TEXT N$ and use those properties to place a FIELD object and another TEXT object based on the relative location of N$.
code example
N$ = "Name:"
DRAW TEXT N$ AT 5,5
N_X = GET XPOS N$ <-- example: might capture X coordinate of N$ object
N_Y = GET YPOS N$ <-- example: might capture Y coordinate of N$ object
N_W = GET WIDTH N$ <-- example: might capture WIDTH of N$ object
N_L = GET LENGTH N$ <-- example: might capture LENGTH of N$ object
N_H = GET HEIGHT N$ <-- example: might capture HEIGHT of N$ object
FIELD N$ TEXT A$ at N_W+15,N_Y
AD$ = "Address:"
DRAW TEXT AD$ at N_X,N_Y+N_H+10
Thank you for your assistance.
Detecting object coordinates in graphics mode
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Detecting object coordinates in graphics mode
No, there are no commands to get interface objects' dimensions.
Instead it is supposed to set these objects' size and position explicitly when creating them, if you need their dimensions.
Instead it is supposed to set these objects' size and position explicitly when creating them, if you need their dimensions.