Skip to content

OSL ‐ Drawing Cursor

Mistium edited this page Nov 7, 2023 · 7 revisions

About

The cursor in this context, refers to the position where the next graphics command will draw a ui element for example


Commands

goto 100 0

square 50 50 10 1

draws a square at 100 0

  • goto x y

    • This command moves the cursor to the specified x and y coordinates on the screen.
    • Example: goto 100 200 would move the cursor to the position (100, 200) on the screen.
  • change_y y:

    • This command changes the y coordinate of the cursor by the specified value.
    • Example: change_y 75 would change the cursor's y-coordinate by 75.
  • change x y:

    • This command changes both the x and y coordinates of the draw cursor to the specified values.
    • Example: change 50 75 would set the draw cursor's position to its previous position + (50, 75).
  • loc a b c d:

    • This command moves the cursor relative to the current frame's dimensions. The parameters a, b, c, and d are used to calculate the new cursor position.
    • The loc command is equivalent to a sequence of commands:
      • goto frame_width * -1 / a frame_height / b sets the cursor's position relative to the frame's dimensions.
      • change c d then adjusts the cursor's position further in the x and y directions.
    • This command allows you to move the cursor relative to the frame's dimensions, which can be useful when dealing with different screen sizes or resolutions.

These cursor positioning commands provide control over the cursor's movement in a graphical environment, enabling you to specify absolute and relative positions on the screen.

Supported in originOS v4.2.4 or later

  • set_x x:

    • This command sets the x coordinate of the cursor to the specified value.
    • Example: set_x 50 would set the cursor's x-coordinate to 50.
  • set_y y:

    • This command sets the y coordinate of the cursor to the specified value.
    • Example: set_y 75 would set the cursor's y-coordinate to 75.

originOS Wiki

Wiki Views:
:views

OSL | RSH | ICN

Clone this wiki locally