/*
          __
         / /_______________  ____  ___
        / __/ ___/ ___/ __ \/ __ \/ _ \
       / /_(__  ) /__/ /_/ / /_/ /  __/
       \__/____/\___/\____/ .___/\___/
                         /_/

    coordinates2.c
    usage of the standard computer-style coordinate system
*/

#include <tscope.h>

int main()
{
    ts_scrsize(SIZE1);

    // if you want to use the standard coordinate system
    // you have to ask explicitly
    ts_coordinates(STANDARD);

    // standard coordinates
    ts_printf(20, 20, "with the standard coordinate system");
    ts_printf(20, 40, "(0,0) will be the left top of the screen");
    ts_circle(0, 0, 20);

    ts_printf(20, 60,
              "all screen positions will have positive coordinates");
    ts_printf_centre(150, 150, "(+,+)");
    ts_button(SXMAX - 20, SYMAX - 20);
    ts_clrscr();

    // SXMAX and SYMAX macro's
    ts_printf(20, 20, "the macros SXMAX and SYMAX contain the");
    ts_printf(20, 40, "horizontal and vertical sizes of the screen");
    ts_circle(SXMAX, SYMAX, 50);
    ts_button(SXMAX - 20, SYMAX - 20);

    ts_printf(20, 80,
              "these values can be used to compute the coordinates of your stimuli");
    ts_line(SXMAX / 2, SYMAX / 4, SXMAX / 2, 3 * SYMAX / 4);
    ts_line(SXMAX / 4, SYMAX / 2, 3 * SXMAX / 4, SYMAX / 2);
    ts_circle(SXMAX / 2, SYMAX / 2, 20);
    ts_button(SXMAX - 20, SYMAX - 20);

    // ax and ay functions
    ts_printf(20, 120,
              "similar things can be done with the functions ax and ay");
    ts_line(ax(.25), ay(.25), ax(.75), ay(.75));
    ts_line(ax(.25), ay(.75), ax(.75), ay(.25));

    ts_button(SXMAX - 20, SYMAX - 20);
    return 0;
}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information