iris

iris

Transform

Transform module

Transformations


Transform~Up constant

Literal value¯1ℂ

Transform~Down constant

Literal value1ℂ

Transform~Left constant

Literal value¯i

Transform~Right constant

Literal valuei

Transform~Coords function

|1Coordinates?Complex

Convert an array from complex coordinates to vector cooridinates

Returns an array with the shape of the orignal, and and an additional 2-long trailing axis. The first component is the X, and the second is the Y. The imaginary part of a complex number corresponds to X and the real part to Y. °Coords takes vector coordinates and gives the complex equivalent.

Source code
Coords(CImpl=3type CoordError|°CImpl=0type CoordError)

Transform~Grid function

|1.2Output1Output2?Input
Source code
Grid˜°°

Collide

Collide module


Collide~Rects function

|4Output?Input1Input2Input3Input4

Check if two rectangles collide ? Size₁ Position₁ Size₂ Position₂

Source code
Rects/×/> ˜() ˜(+°T~Coords)

Collide~Circles function

|4Output?Input1Input2Input3Input4

Check if two circles collide ? Radius₁ Center₁ Radius₂ Center₂

Source code
Circles<(+|-°T~Coords):

Collide~CirclePoint function

|3Output?RadiusCenterPoint

Check if a point is inside a circle

Source code
CirclePoint(-°T~Coords)

Collide~RectPoint function

|2Output?RectPoint

Check if a point is inside a rectangle

Source code
RectPoint×××° °\+° °T~Coords

Collide~RectCircle function

|3Output?RectRadiusCenter

Check if a rectangle and a circle collide

Source code
RectCircle> - () °\+°°T~Coords :

Color

Color module


Color~Clear constant

Literal value[0 0 0 0]

A color with an opacity of zero

Color~Rgb function

|1UiuaColor?RgbColor

Convert a color from 8-bit rgb to Uiua colors

Uiua color channels are represented by values 0-1, while standard graphics uses integers from 0-255. Colors are rounded to four decimal places so that they display nicely (this will not affect their 8-bit value.) °Rgb converts a Uiua color back to an 8-bit color. Both Rgb and °Rgb clamp the values to be within the correct ranges.

Source code
Rgb(01) ÷255 °(0255)

Color~Hex function

|1Color?HexString

Convert a hexadecimal string into a color

Expects a string in the form #RRGGBB where all the letters are hexadecimal digits corresponding to color channels. The leading # can be omitted, and and alpha channel can also be specified at the end. This function is pervasive, and will convert an array of strings, or an array of box strings into an array of colors. The output will always be non-box, so if a single string has an alpha channel, all of the output will. °Hex converts a color back into a hexidecimal string, always including the #.

Source code
Hex((
(1^0|^0)=1type ¯
| (@f°^0|°^0)=0type))!(
(@#|@#)
("Hex string must be characters"=1type
"Hex string must have 6 or 8 characters"[6]_[8])
("Hex string has invalid characters"¬˜) ˜HexDigits
Rgb 16°0 (_2|)
°("Color must be numbers"=0type
"Color must be 3 or 4 digits"[3]_[4])
)

Color~Alpha function

|1Output?Input

Get the alpha channel (transparency) of an image

If Alpha is called on an image without an alpha channel, a fully opaque one will be added. ⍜Alpha edits the alpha channel, and °⊸Alpha can be used to set it. For either inverse if a scalar is provided the entire alpha channel will be set to it. 0 is fully transparent and 1 is fully opaque.

Source code
Alpha° ((˜1|°1||)ColorFormat)

Color~Rosewater constant

Literal value[0.961 0.878 0.863]

Color~Flamingo constant

Literal value[0.949 0.804 0.804]

Color~Pink constant

Literal value[0.961 0.761 0.906]

Color~Mauve constant

Literal value[0.796 0.651 0.969]

Color~Red constant

Literal value[0.953 0.545 0.659]

Color~Maroon constant

Literal value[0.922 0.627 0.675]

Color~Peach constant

Literal value[0.98 0.702 0.529]

Color~Yellow constant

Literal value[0.976 0.886 0.686]

Color~Green constant

Literal value[0.651 0.89 0.631]

Color~Teal constant

Literal value[0.58 0.886 0.835]

Color~Sky constant

Literal value[0.537 0.863 0.922]

Color~Sapphire constant

Literal value[0.455 0.78 0.925]

Color~Blue constant

Literal value[0.537 0.706 0.98]

Color~Lavender constant

Literal value[0.706 0.745 0.996]

Color~Text constant

Literal value[0.804 0.839 0.957]

Color~Subtext function

|1Output?Input
Source code
Subtext˜Hex "#a6adc8"_"#bac2de"

Color~Overlay function

|1Output?Input
Source code
Overlay˜Hex "#6c7086"_"#7f849c"_"#9399b2"

Color~Surface function

|1Output?Input
Source code
Surface˜Hex "#313244"_"#45475a"_"#585b70"

Color~Base constant

Literal value[0.118 0.118 0.18]

Color~Mantle constant

Literal value[0.094 0.094 0.145]

Color~Crust constant

Literal value[0.067 0.067 0.106]

Window

Window module


Window~Full function

|0Output?

Check if the window is fullscreen

Full returns a boolean to tell if the window is in fullscreen mode. °Full can be passed a boolean to set the state of fullscreen mode. A common pattern to toggle fullscreen is ⍜Full¬.

Source code
Full(
Rayua~IsWindowFullscreen
| (˜$"Fullscreen state must be a boolean, but it is _"F)¬10_1
Rayua~ToggleFullscreenRayua~IsWindowFullscreen)

Window~Size function

|0Output?

The size of the window

The dimensions returned are in pixels. °Size sets the size of the window. If the window is in fullscreen mode when °Size is called, fullscreen mode with be turned off. Neither dimension of the window can be zero. If a single number is given as the dimensions, it will be used as both the width and the height.

Source code
Size(°T~Coords (
Os‼macos÷ Rayua~GetRenderWidth Rayua~GetRenderHeight
| (˜0$"Window size must be greater than zero, but it is _"F) ¬×(1/×>0|[2]) (2)[] °Full 0
Rayua~SetWindowSize °))

Window~FullSize function

|0Output?

Get the size of the window when it is fullscreen

Source code
FullSize(°T~Coords Rayua!GetMonitorWidth GetMonitorHeight Rayua~GetCurrentMonitor)

Window~FPS function

|0Output?

The active FPS (framerate)

FPS returns the actual framerate, which varies based on how long your device takes to run a frame. °FPS sets the maximum FPS. By default, the FPS is unbounded, and frames will be run as fast as possible. FPS can take to have the fastest possible framerate (the default behavior.)

Source code
FPS(
Rayua~GetFPS
| (˜0$"FPS must be greater than zero, but it is _"F)¬×(>0|[])
Rayua~SetTargetFPS)

Sound

Sound module


Sound~Data data boxed

Buffer
Clone

Sound~Unload function

|1.0?Input

Unload a sound, freeing it's memory

Source code
Unload(Rayua~UnloadSound "Cannot free an active sound, only a source sound." Data!Clone Buffer)

Sound~Play function

|1ActiveSound?SourceSound
Source code
PlayData1 Rayua~PlaySound Rayua~LoadSoundAlias Data~Buffer

Sound~Start function

|1Output?Input
Source code
StartData~BufferRayua~PlaySound

Texture

Texture module


Texture~Data data boxed

Buffer
ColorFormat
Type

Texture~Unload function

|1.0?Texture

Unload a texture, freeing it's memory

Once a texture is unloaded, attempting to draw it will result in an all-black texture. Calling this function multiple times on a texture will not doing anything.

Source code
UnloadRayua~UnloadTexture Data~Buffer

Texture~Size function

|1Size?Texture

Get the dimensions of a texture

Source code
Size(Rayua~Texture!Width Height Data~Buffer)

Texture~LoadFile function

|1Texture?Path

Load a texture from a filepath

The file must contain an image, and have the proper extension for the image format. The color format of a texture created this way is always color with an alpha channel. ⍜LoadFile will load the texture, and then free the memory when the function is over. [NOTE] You cannot load a texture before Open is called, it will cause a segfault.

Source code
LoadFile((^0|.^0|^1))!(Data 3 Rayua~LoadTexture|Unload)

Texture~Image function

|1Image?Texture

Get the image in a texture without unloading the texture

Image remembers the color format of the image you made the texture with. If you provided a grayscale, you will get back a grayscale. °⊸Image edits the image in a texture. It takes the new image as the first argument and the texture as the second argument. ⍜Image gets the image, allows you to change it, and then puts the new image back in the texture. If any of the properties of the image are altered, like the shape or the color format, this function will error.

Source code
Image((^0|^0|^1))!(
°ToRayImage Data~Buffer Rayua~LoadImageFromTexture
| (Rayua~UpdateTexture Data~Buffer)( °Color~Rgb ToFullColor) ˜ImageError)

Texture~LoadImage function

|1Texture?Image

Load a texture from a Uiua image array

The provided image can be in any color format a Uiua image can be in, except for complex domain coloring. The formats are defined in the Uiua tutorial. The format you use to create the texture is the only one that may be used by the texture. Calling Image will result in an image of the same format. [NOTE] You cannot load a texture before Open is called, it will cause a segfault.

Source code
LoadImage((^0|^1|.^0|^2))(
Data~Buffer Rayua~LoadTextureFromImage ToRayImage
| UnloadImage
| Unload)

Texture~Draw function has optional arguments

|3.0?TextureSizePosColor:Angle:Centered:

Draw a texture on the window

Color tints a texture a particular color. Angle is given in rotations [0,1], clockwise. Optional args: Color Angle Centered

Source code
~Draw {Color White|Angle 0|Centered 0} (
(Color|Angle||Centered)
(ColorArg | ×3601 | (Data~Buffer|0_0°Size)
| ( (+÷)¬|÷) ˜PosArg SizeArg)
Rayua~DrawTexturePro S!cdefba
)

Texture~DrawScreen function has optional arguments

|1.0?TextureColor:

This function is DEPRECATED use Draw~Background instead

Draw a texture covering the whole window.

The texture will be stretched/scaled to properly fit the size of the window. DrawScreen also supports a Color arg, like Draw Optional args: Color

Source code
~DrawScreen [Color White] Draw (Window~Size 0_0) Color:Color

Draw

Draw module

Draw different shapes onto the window


Draw~Background function

|1.0?Background

Fill the whole window with a color or texture

When given a color, Background covers the whole window with that color. When given a texture Background scales the texture to fit over the whole window.

Source code
Background(
IsTexture
(Rayua~ClearBackground "Background does not take multiple colors"[4] ° ColorArg
| Texture~Draw(Window~Size 0_0))
)

Draw~Line function

|4.0?ColorThicknessAB

Draw a line on the window

A line will draw from point A to point B, even if either are outside the window. A thickness of zero will cause the line not to draw at all.

Source code
LineRayua~DrawLineEx S!cdba (ColorArg||PosArg)

Draw~Circle function has optional arguments

|3.0?ColorRadiusCenterAngle:Start:

Draw a circle on the window

An angle and a starting position can be supplied to draw a sector of the circle. Angle can have the range [-1,1] where positive is clockwise. Start can have the range [0,1] where 0 is upward also moving clockwise. Optional args: Angle Start

Source code
~Circle {Angle 1|Start 0} (
Angle Start
1(×32|(-90×360) +) (||ColorArg||PosArg) # B Segments End Start Color Radius Center ?
(Rayua~DrawCircleSector S!fecbad|Rayua~DrawCircle S!fed)
)

Draw~Text function has optional arguments

|4.0?ColorSizePositionTextCentered:Font:Spacing:

Print text to the window

Font is a filepath pointing to a font file. If not specified, the Raylib font is used. Spacing changes how far apart characters are placed from eachother. By default it is 10% of the fontsize. Centered centers the text both horizontally and vertically. Optional args: Font Spacing Centered

Source code
~Text {Centered 0|Font |Spacing 0} (
(Centered|Font|Spacing)
((||ColorArg||PosArg|$"_"BoxStrings)
S!afedbc LoadFont (÷₁₀)
) # Centered Font Text Pos Size Spacing Color ?
(Rayua~DrawTextEx(- (÷Rayua~MeasureTextEx)))
)

Draw~Rect function has optional arguments

|3.0?ColorSizePositionCentered:

Draw a rectangle on the window

Optional args: Centered

TODO: Change back once pervasion is fixed

Source code
~Rect [Centered 0] Rayua~DrawRectangle S!bca (ColorArg|(-÷) ˜PosArg SizeArg) Centered # TODO: Change back once pervasion is fixed

Draw~Square function has optional arguments

|3.0?ColorSizePositionCentered:

Draw a square on the window

Exactly like Rect, except that the size is a scalar instead of a vector Optional args: Centered

Source code
~Square [Centered 0] Rect (2) Centered:Centered

Key

Key module


Key~Space constant

Literal value@

Key~Pressed function

|1Output?Key

Check if a key was pressed once

Source code
Pressed(Rayua~IsKeyPressed Fix)

Key~Down function

|1Output?Key

Check if a key is down

Source code
Down(Rayua~IsKeyDown Fix)

Key~Pressed‼ index macro

?KeyFunction

Call a function when a key is pressed

The first function is the key to run the function on (or identity to take from the stack) The second function will be called when the key is pressed

Source code
Pressed‼(^1)Pressed ^0

Key~Down‼ index macro

?KeyFunction

Call a function when a key is down

The first function is the key to run the function on (or identity to take from the stack) The second function will be called when the key is down

Source code
Down‼(^1)Down ^0

Key~Typed function

|0Output?

Get the characters that the user has typed

This function returns a string of queued characters If the user has not typed since the function was called, the string will be empty

Source code
Typed((:@\0Rayua~GetCharPressed) "")

Key~TypedCodes function

|0Output?

Get the key codes that the user has typed

This function returns an array of queued key codes If the user has not typed since the function was called, the array will be empty

Source code
TypedCodes((:0Rayua~GetKeyPressed) [])

Key~Input function

|1Output?Input

Emulate a text input on a string

This function edits a string based on the user's keyboard inputs Typing alphanumerics will append to the string, as well as non-printing characters like newline, space, and tab The string will also respect backspace and the Delete key to clear the string

Source code
Input(
˜Delete TypedCodes :Typed
((-@\0) =@\0 : ˜"\0\n\t"˜[Backspace Enter Tab]
| "")
)

Key~Arrow function

|1Key?Character

Get an arrow key for a specific direction ^: Up, v: Down, <: Left, >: Right

Source code
Arrowget(map "^v<>" Rayua~Key![Up Down Left Right])

Key~F function

|1Key?Number

Get a particular function key

Source code
Fget(map¯12 +29012)

Key~WASD function

|1Direction?Pressed

Returns array of direction constants for WASD keys pressed Takes a boolean to choose between keypress and keydown

Source code
WASDImpl"wasd"

Key~ULDR function

|1Direction?Pressed

Returns array of direction constants for arrow keys pressed Takes a boolean to choose between keypress and keydown

Source code
ULDRImpl(Arrow "^<v>")

Mouse

Mouse module


Mouse~Pressed function

|1Output?Button

Check if a mouse button was pressed once

Source code
PressedRayua~IsMouseButtonPressed

Mouse~Down function

|1Output?Button

Check if a mouse button is down

Source code
DownRayua~IsMouseButtonDown

Mouse~Pos function

|0Output?

The current position of the mouse

Source code
Pos(°T~Coords Rayua~GetMousePosition)

Mouse~Change function

|0Output?

How many pixels the mouse has moved since the last frame

Source code
Change(°T~Coords Rayua~GetMouseDelta)

Mouse~Hide function

|0.0

Hide the mouse from the user

°Hide will make the mouse reappear. The user can still use the mouse while it it hidden. The affect is purely visual.

Source code
Hide(Rayua~HideCursor|Rayua~ShowCursor)

Mouse~Scroll function

|0Output?

The direction the mouse is scrolling

Returns 0 if the mouse has not scrolled, and 1 or ¯1 depending on the direction scrolled. The sign may not nicely correspond to 'up' or 'down' since the direction of scrolling depends on the user's device.

Source code
Scroll(Rayua~GetMouseWheelMoveV)

Mouse~Scroll! index macro

Call a function on the scroll direction when the wheel is scrolled

The function will be called on a value of either 1 or ¯1, but never 0

Source code
Scroll!(^0) 0 Scroll

Mouse~Drag‼ index macro

?ButtonFunction

Call a function when the user drags the mouse

The first function is the mouse button that must be down while dragging. If it is monadic it will pull from the stack. The second function is called when a drag occurs and is supplied the distance dragged. If the mouse does not move, this will not trigger, thus the distance cannot be zero.

Source code
Drag‼(^1) ×Down (0 Change) ^0

Mouse~Pressed‼ index macro

?ButtonFunction

Call a function on the mouse position when a button is pressed

The first function is the button to run the function on (or identity to take from the stack) The second function will be called with the mouse position as its first argument

Source code
Pressed‼(^1 Pos)Pressed ^0

Mouse~Down‼ index macro

?ButtonFunction

Call a function on the mouse position when a button is down

The first function is the button to run the function on (or identity to take from the stack) The second function will be called with the mouse position as its first argument

Source code
Down‼(^1 Pos)Down ^0

Mouse~OnWindow function

|0Output?

Check if the mouse is on the window

Source code
OnWindow(Rayua~IsCursorOnScreen)

Mouse~OnScreen function

|0Output?
Source code
OnScreen(OnWindow)

Index macros

Loop‼ index macro

?ConditionalBody
Source code
Loop‼Rayua~CloseWindow (
Rayua~EndDrawing ^1 Rayua~BeginDrawing
| ׬Rayua~WindowShouldClose ^0)

Loop! index macro

?Body
Source code
Loop!Loop‼1^0

Noadic functions

Debug function

|0.0

Sets the trace log to DEBUG, printing extra information about what Raylib is doing

Source code
DebugRayua~SetTraceLogLevel Rayua~TraceLogLevel~Debug

Dt function

|0Output?

Delta-time since last frame in seconds

Source code
Dt(Rayua~GetFrameTime)

Dyadic functions

Open function

|2.0?SizeTitle

Open a new window with a title

Source code
OpenRayua~InitWindow (° (2)[] T~Coords|$"_") Rayua~SetTraceLogLevel Rayua~TraceLogLevel~Warning