The Basic Conception - Absolute Coordinates

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques > Dynamic Positioning >

The Basic Conception - Absolute Coordinates

Previous pageReturn to chapter overviewNext page

Objects can be positioned and sized with absolute coordinates.  There are mostly two coordinate pairs left, top and right, bottom to set the position of the top left corner and the bottom right corner of an object:

 

Rectangle                                example for a circle, which is a rectangular object in VPE

left, top                                left, top

ProgrammersManual_img1                        ProgrammersManual_img2

          right, bottom                         right, bottom

 

NOTE: You must specify all coordinates in normalized form, this means, the following conditions have to be met:
left <= right and top <= bottom, otherwise the object will not display correctly.

Example:

Box(1, 1, 5, 5) is correct

Box(5, 5, 1, 1) is incorrect

Box(1, 5, 5, 1) is incorrect

 

Instead of specifying the bottom right corner in absolute coordinates, you can use negative values for the right and bottom coordinates. These values are then interpreted as width and height of the object.

Example:

Box(1, 1, 7, 9)

Uses absolute coordinates and draws a box with the top left corner at 1, 1 and the bottom right corner at 7, 9.

 

Box(1, 1, -6, -8)

Draws exactly the same box whilst specifying the width and the height of the box.