Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>set_world()</b> c_exam05 http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SET_WORLD()                                                         C_EXAM05
   Sets the scaling factor, origin and direction of the axes.

   Syntax
         SET_WORLD(nXScale,nYScale,nXOrg,nYOrg,nXDir,nYDir)

   Arguments
         nXScale     Sets the units in X direction.
         nYScale     Sets the units in Y direction.
         nXOrg       Sets the left X value.
         nYOrg       Sets the top Y value.
         nXDir       Sets the X scale direction.
                     1 = Left to right.
                     -1 = Right to left.
         nYDir       Sets the Y scale direction.
                     1 = Top to bottom.
                     -1 = Bottom to top.

   Returns
         WLD_XORG()   Returns the X origin.
         WLD_YORG()   Returns the Y origin.
         WLD_XSCALE() Returns the X scale.
         WLD_YSCALE() Returns the Y scale.
         WLD_XDIR()   Returns the X scale direction.
         WLD_YDIR()   Returns the Y scale direction.

   Description
         SET_WORLD() is used to set three attributes for the current view-
         port: its scaling factor, origin, and the direction in which the
         axes run. These attributes determine how a coordinate, entered as
         a function argument, is translated to the physical screen location.

         On the standard screen, X increases from left to right and Y
         increases from top to bottom. The nXDir and nYDir can reverse
         either direction by using -1 for the argument. Thus, you could
         have Y increase from bottom to top.

         The scaling factors, nXScale and nYScale, set the physical screen
         resolution to a logical screen of nXScale units. For example, an
         EGA screen with 640 physical pixels can be set to a logical screen
         of 5000 pixels with nXScale. Each viewport can have it's own
         logical size. The scaling routine automatically rounds to the
         nearest pixel. To make the aspect ratio of the world coordinate
         system square, enter a 0 value for the nYScale parameter. This
         will automatically calculate the nYScale factor so the aspect
         ratio is one to one, or square.

         The origin, nXOrg, and nYOrg, specify the initial screen offset, or
         location of the logical point (0,0). When a viewport is opened,
         the location of its origin is in the upper left corner. The new
         location is always relative to this initial spot and is calculated
         using the latest scaling factors. To set an origin at the opposite
         end, its value should be one less than the scale factor. Thus to
         set nYOrg at the bottom of a viewport whos nYScale is 100, set
         nYOrg to 99.

         This can help you write graphics software wihtout worrying about
         the monitor's resolution.

   Note: Do not use the SET_WORLD() when producing a graph because the
         graphing functions use their own scaling.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson