FluidBackend

FluidBackend is an interface making it possible to bind Fluid to a library other than Raylib.

The default unit in graphical space is a **pixel** (px), here defined as **1/96 of an inch**. This is unless stated otherwise, as in Texture.

Warning: Backend API is unstable and functions may be added or removed with no prior warning.

@safe
interface FluidBackend {}

Members

Functions

area
Rectangle area(Rectangle rect)

Set area within the window items will be drawn to; any pixel drawn outside will be discarded.

area
Rectangle area()
Undocumented in source.
clipboard
string clipboard(string )

Get or set system clipboard value.

clipboard
string clipboard()
Undocumented in source.
deltaTime
float deltaTime()

Get time elapsed since last frame in seconds.

doubleClickTime
Duration doubleClickTime()

Get system's double click time.

dpi
Vector2 dpi()

Get horizontal and vertical DPI of the window.

drawCircle
void drawCircle(Vector2 center, float radius, Color color)

Draw a circle.

drawCircleOutline
void drawCircleOutline(Vector2 center, float radius, Color color)

Draw a circle, but outline only.

drawLine
void drawLine(Vector2 start, Vector2 end, Color color)

Draw a line.

drawRectangle
void drawRectangle(Rectangle rectangle, Color color)

Draw a rectangle.

drawTexture
void drawTexture(Texture texture, Rectangle rectangle, Color tint)

Draw a texture.

drawTextureAlign
void drawTextureAlign(Texture texture, Rectangle rectangle, Color tint)

Draw a texture, but ensure it aligns with pixel boundaries, recommended for text.

drawTriangle
void drawTriangle(Vector2 a, Vector2 b, Vector2 c, Color color)

Draw a triangle, consisting of 3 vertices with counter-clockwise winding.

hasJustResized
bool hasJustResized()

True if the user has just resized the window.

hidpiScale
Vector2 hidpiScale()

Get the DPI value for the window as a scale relative to 96 DPI.

inputCharacter
dchar inputCharacter()

Get next queued character from user's input. The queue should be cleared every frame. Return null if no character was pressed.

isDown
bool isDown(MouseButton )
Undocumented in source.
isDown
bool isDown(KeyboardKey )
Undocumented in source.
isDown
int isDown(GamepadButton button)
Undocumented in source.
isPressed
bool isPressed(MouseButton )

Check if the given mouse button has just been pressed/released or, if it's held down or not (up).

isPressed
bool isPressed(KeyboardKey )

Check if the given keyboard key has just been pressed/released or, if it's held down or not (up).

isPressed
int isPressed(GamepadButton button)

Check if the given gamepad button has been pressed/released or, if it's held down or not (up) on any of the connected gamepads.

isReleased
bool isReleased(MouseButton )
Undocumented in source.
isReleased
bool isReleased(KeyboardKey )
Undocumented in source.
isReleased
int isReleased(GamepadButton button)
Undocumented in source.
isRepeated
bool isRepeated(KeyboardKey )

If true, the given keyboard key has been virtually pressed again, through a long-press.

isRepeated
int isRepeated(GamepadButton button)

If true, the given gamepad button has been virtually pressed again, through a long-press.

isUp
bool isUp(MouseButton )
Undocumented in source.
isUp
bool isUp(KeyboardKey )
Undocumented in source.
isUp
int isUp(GamepadButton button)
Undocumented in source.
loadTexture
Texture loadTexture(Image image)

Load a texture from memory or file.

loadTexture
Texture loadTexture(string filename)
Undocumented in source.
mouseCursor
FluidMouseCursor mouseCursor(FluidMouseCursor )

Get or set mouse cursor icon.

mouseCursor
FluidMouseCursor mouseCursor()
Undocumented in source.
mousePosition
Vector2 mousePosition(Vector2 )

Get/set mouse position

mousePosition
Vector2 mousePosition()
Undocumented in source.
reaper
TextureReaper* reaper()

Texture reaper used by this backend. May be null.

restoreArea
void restoreArea()

Restore the capability to draw anywhere in the window.

scale
float scale()
float scale(float )

Set scale to apply to whatever is drawn next.

scroll
Vector2 scroll()

Get scroll value on both axes.

tint
Color tint(Color )

Set tint for all newly drawn shapes. The input color for every shape should be multiplied by this color.

tint
Color tint()

Get current tint color.

unloadTexture
void unloadTexture(uint id)
void unloadTexture(Texture texture)

Destroy a texture created by this backend. Always use texture.destroy() to ensure thread safety and invoking the correct backend.

updateTexture
void updateTexture(Texture texture, Image image)

Update a texture from an image. The texture must be valid and must be of the same size and format as the image.

windowSize
Vector2 windowSize(Vector2 )

Get or set the size of the window.

windowSize
Vector2 windowSize()
Undocumented in source.

Meta