parin.types

Common parin types.

Types 17

aliasUpdateFunc = bool function(float dt)
aliasCallFunc = void function()
enumAlignment : ubyte

Alignment orientations.

leftAlign to the left.
centerAlign to the center.
rightAlign to the right.
enumFilter : ubyte

Texture filtering modes.

nearestNearest neighbor filtering (blocky).
linearBilinear filtering (smooth).
enumWrap : ubyte

Texture wrapping modes.

clampClamps texture.
repeatRepeats texture.
enumBlend : ubyte

Texture blending modes.

alphaStandard alpha blending.
additiveAdds colors for light effects.
multipliedMultiplies colors for shadows.
addSimply adds colors.
subSimply subtracts colors.
enumKeyboard : ubyte

A limited set of keyboard keys.

noneNot a key.
apostropheThe `'` key.
commaThe `,` key.
minusThe `-` key.
periodThe `.` key.
slashThe `/` key.
n0The 0 key.
n1The 1 key.
n2The 2 key.
n3The 3 key.
n4The 4 key.
n5The 5 key.
n6The 6 key.
n7The 7 key.
n8The 8 key.
n9The 9 key.
nn0The 0 key on the numpad.
nn1The 1 key on the numpad.
nn2The 2 key on the numpad.
nn3The 3 key on the numpad.
nn4The 4 key on the numpad.
nn5The 5 key on the numpad.
nn6The 6 key on the numpad.
nn7The 7 key on the numpad.
nn8The 8 key on the numpad.
nn9The 9 key on the numpad.
semicolonThe `;` key.
equalThe `=` key.
aThe A key.
bThe B key.
cThe C key.
dThe D key.
eThe E key.
fThe F key.
gThe G key.
hThe H key.
iThe I key.
jThe J key.
kThe K key.
lThe L key.
mThe M key.
nThe N key.
oThe O key.
pThe P key.
qThe Q key.
rThe R key.
sThe S key.
tThe T key.
uThe U key.
vThe V key.
wThe W key.
xThe X key.
yThe Y key.
zThe Z key.
bracketLeftThe `[` key.
bracketRightThe `]` key.
backslashThe `\` key.
graveThe `` ` `` key.
spaceThe space key.
escThe escape key.
enterThe enter key.
tabThe tab key.
backspaceTHe backspace key.
insertThe insert key.
delThe delete key.
rightThe right arrow key.
leftThe left arrow key.
downThe down arrow key.
upThe up arrow key.
pageUpThe page up key.
pageDownThe page down key.
homeThe home key.
endThe end key.
capsLockThe caps lock key.
scrollLockThe scroll lock key.
numLockThe num lock key.
printScreenThe print screen key.
pauseThe pause/break key.
shiftThe left shift key.
shiftRightThe right shift key.
ctrlThe left control key.
ctrlRightThe right control key.
altThe left alt key.
altRightThe right alt key.
winThe left windows/super/command key.
winRightThe right windows/super/command key.
menuThe menu key.
f1The f1 key.
f3The f3 key.
f2The f2 key.
f4The f4 key.
f5The f5 key.
f6The f6 key.
f7The f7 key.
f8The f8 key.
f9The f9 key.
f10The f10 key.
f11The f11 key.
f12The f12 key.
aliasKey = Keyboard

An alias for the Keyboard enum. It's useful for keeping code concise. Prefer using the original enum for function parameters.

enumMouse : ubyte

A limited set of mouse keys.

noneNot a button.
leftThe left mouse button.
rightThe right mouse button.
middleThe middle mouse button.
enumGamepad : ubyte

A limited set of gamepad buttons.

noneNot a button.
leftThe left button.
rightThe right button.
upThe up button.
downThe down button.
yThe Xbox y, PlayStation triangle and Nintendo x button.
xThe Xbox x, PlayStation square and Nintendo y button.
aThe Xbox a, PlayStation cross and Nintendo b button.
bThe Xbox b, PlayStation circle and Nintendo a button.
ltThe left trigger button.
lbThe left bumper button.
lsbThe left stick button.
rtThe right trigger button.
rbThe right bumper button.
rsbThe right stick button.
backThe back button.
startThe start button.
middleThe middle button.
structSurface

A pixel buffer.

Fields
Rgba[] pixels
int width
int height
Filter filter
Wrap wrap
bool isOwning
Methods
void free(IStr file = __FILE__, Sz line = __LINE__) @trusted nothrowFrees the memory if it is owning it and resets the state.
Vec2 size()Returns the size of the surface as a vector.
int pitch()Returns the number of bytes per row of pixels.
void fill(Rgba color)Fills the entire surface with a single color.
Constructors
this(int width, int height, IStr file = __FILE__, Sz line = __LINE__)Creates a new surface with the specified width, and height.
this(Rgba[] pixels, int width, int height)Creates a new surface with the specified pixels, width, and height.
structGlyphInfo
Fields
int value
IVec2 offset
int advanceX
IRect rect

Options for configuring drawing parameters.

Fields
Vec2 origin
Vec2 scale
float rotation
Rgba color
Hook hook
Flip flip
ubyte layer
Constructors
this(float rotation, Hook hook = Hook.topLeft, ubyte layer = 0)
this(Vec2 scale, Hook hook = Hook.topLeft, ubyte layer = 0)
this(Rgba color, Hook hook = Hook.topLeft, ubyte layer = 0)
this(Flip flip, Hook hook = Hook.topLeft, ubyte layer = 0)
this(Hook hook, ubyte layer = 0)

Options for configuring extra drawing parameters for text.

Fields
float visibilityRatio
int alignmentWidth
ushort visibilityCount
Alignment alignment
bool isRightToLeft
Constructors
this(float visibilityRatio)
this(Alignment alignment, int alignmentWidth = 0)
structCamera

A camera.

Fields
Vec2 position
Vec2 offset
float rotation
float scale
bool isCentered
bool isAttached
Methods
float x() @trusted refThe X position of the camera.
float y() @trusted refThe Y position of the camera.
Vec2 sum()The sum of the position and the offset of the camera.
Hook hook()Returns the current hook associated with the camera.
Vec2 origin(Vec2 canvasSize)Returns the origin of the camera.
Rect area(Vec2 canvasSize)Returns the area covered by the camera.
Vec2 topLeftPoint(Vec2 canvasSize)Returns the top left point of the camera.
Vec2 topPoint(Vec2 canvasSize)Returns the top point of the camera.
Vec2 topRightPoint(Vec2 canvasSize)Returns the top right point of the camera.
Vec2 leftPoint(Vec2 canvasSize)Returns the left point of the camera.
Vec2 centerPoint(Vec2 canvasSize)Returns the center point of the camera.
Vec2 rightPoint(Vec2 canvasSize)Returns the right point of the camera.
Vec2 bottomLeftPoint(Vec2 canvasSize)Returns the bottom left point of the camera.
Vec2 bottomPoint(Vec2 canvasSize)Returns the bottom point of the camera.
Vec2 bottomRightPoint(Vec2 canvasSize)Returns the bottom right point of the camera.
void floor()
void ceil()
void round()
void followPosition(Vec2 target, float delta)Moves the camera to follow the target position at the specified speed.
void followPositionWithSlowdown(Vec2 target, float delta, float slowdown)Moves the camera to follow the target position with gradual slowdown.
void followScale(float target, float delta)Adjusts the camera’s zoom level to follow the target value at the specified speed.
void followScaleWithSlowdown(float target, float delta, float slowdown)Adjusts the camera’s zoom level to follow the target value with gradual slowdown.
Constructors
this(Vec2 position, bool isCentered = false)
this(float x, float y, bool isCentered = false)
structTask

Represents a scheduled task with interval, repeat count, and callback function.

Fields
float interval
float time
byte count
Methods
bool update(float dt)Updates the task, similar to the main update function.

Functions 1

fnFlip oppositeFlip(Flip flip, Flip fallback)Returns the opposite flip value. The opposite of every flip value except none is none. The fallback value is returned if the flip value is none.