[][src]Crate rltk

Modules

console
embedding
prelude
rex

Macros

add_wasm_support
embedded_resource
link_resource
link_resource
smallvec

Creates a SmallVec containing the arguments.

Structs

AlphaLerp

Implements an Alpha-Only Lerp as an iterator

BACKEND
BACKEND_INTERNAL
BTerm

A BTerm context.

BTermBuilder

Provides a builder mechanism for initializing BTerm. You can chain builders together, and and with a call to .build(). This allows you to provide settings if you want to, or just use a simple initializer if you are in a hurry.

BTermInternal
BTermPlatform

Provides a base abstract platform for BTerm to run on, with specialized content.

Bresenham

Line-drawing iterator

BresenhamCircle

An implementation of [Bresenham's circle algorithm]. [Bresenham's circle algorithm]: http://members.chello.at/~easyfilter/bresenham.html Derived from the line_drawing crate, but specialized to use BTerm's types.

BresenhamCircleNoDiag

A version of the Bresenham circle that does not make diagonal jumps

ColorPair

Represents two colors together, a foreground and a background.

Degrees

Convenience type: you can define an angle in Degrees and it is convertible to Radians (and vice versa)

DiceIterator
DiceParseError
DiceType
DijkstraMap

Representation of a Dijkstra flow map. map is a vector of floats, having a size equal to size_x * size_y (one per tile). size_x and size_y are stored for overflow avoidance. max_depth is the maximum number of iterations this search shall support.

DisplayConsole

A display console, used internally to provide console render support. Public in case you want to play with it, or access it directly.

DrawBatch

Represents a batch of drawing commands, designed to be submitted together.

EMBED
FastNoise
FlexiConsole

A sparse console. Rather than storing every cell on the screen, it stores just cells that have data.

FlexiTile

Internal storage structure for sparse tiles.

Font

BTerm's representation of a font or tileset file.

HSV

Represents an H/S/V triplet, in the range 0..1 (32-bit float)

HsvLerp

An HSV Lerp - transition from one HSV color to another in a set number of steps.

INPUT
InitHints
Input

Represents the current input state. The old key/mouse fields remain available for compatibility.

MultiTileSprite

Represents a sprite consisting of multiple glyphs/colors, occupying multiple console locations.

NavigationPath

Holds the result of an A-Star navigation query. destination is the index of the target tile. success is true if it reached the target, false otherwise. steps is a vector of each step towards the target, including the starting position.

Point

Helper struct defining a 2D point in space.

Point3

Helper struct defining a 2D point in space.

RGB

Represents an R/G/B triplet, in the range 0..1 (32-bit float)

RGBA

Represents an R/G/B triplet, in the range 0..1 (32-bit float)

Radians

Convenience type: you can define an angle in Radians and it is convertible to Degrees (and vice versa)

RandomNumberGenerator
Rect
RectF
RenderSprite

Internal storage structure for sparse tiles.

RgbLerp

Implements an RGB Lerp as an iterator

RgbaLerp

Implements an RGBA Lerp as an iterator

Rltk

A BTerm context.

RltkBuilder

Provides a builder mechanism for initializing BTerm. You can chain builders together, and and with a call to .build(). This allows you to provide settings if you want to, or just use a simple initializer if you are in a hurry.

Shader
SimpleConsole

A simple console with background color.

SmallVec

A Vec-like container that can store a small number of elements inline.

SparseConsole

A sparse console. Rather than storing every cell on the screen, it stores just cells that have data.

SparseTile

Internal storage structure for sparse tiles.

Sprite
SpriteConsole

A sparse console. Rather than storing every cell on the screen, it stores just cells that have data.

SpriteSheet
TextBlock
TextBuilder
Tile

The internal storage type for tiles in a simple console.

VectorLine
VirtualConsole
XpCell

Structure representing a character and its foreground/background color

XpColor

Structure representing the components of one color

XpFile

Structure representing a REXPaint image file which is a stack of layers

XpLayer

Structure representing a layer Cells are in the same order as in the file, in column-major order (index of position x,y is y*height + x).

Enums

BEvent

Available device events

CellularDistanceFunction

Cellular noise distance function to use

CellularReturnType

What type of cellular noise result do you want

CharacterTranslationMode
CommandType
DistanceAlg

Enumeration of available 2D Distance algorithms

DrawCommand

Represents a buffered drawing command that can be asynchronously submitted to the drawing buffer, for application at the end of the frame.

FractalType

Fractal function to use

HtmlColorConversionError

Error message type when failing to convert a hex code to RGB.

Interp

Interpolation function to use

LineAlg

Enumeration of available 2D Distance algorithms

NoiseType

Type of noise to generate

TextAlign
VirtualKeyCode

Symbolic name for a keyboard key.

Constants

ALICEBLUE
ALICE_BLUE
ANTIQUEWHITE
ANTIQUEWHITE1
ANTIQUEWHITE2
ANTIQUEWHITE3
ANTIQUEWHITE4
ANTIQUE_WHITE
AQUA
AQUAMARINE
AQUAMARINE1
AQUAMARINE2
AQUAMARINE3
AQUAMARINE4
AZURE
AZURE1
AZURE2
AZURE3
AZURE4
BEIGE
BISQUE
BISQUE1
BISQUE2
BISQUE3
BISQUE4
BLACK
BLANCHEDALMOND
BLANCHED_ALMOND
BLUE
BLUE1
BLUE2
BLUE3
BLUE4
BLUEVIOLET
BLUE_VIOLET
BROWN1
BROWN2
BROWN3
BROWN4
BROWN_42
BURLYWOOD
BURLYWOOD1
BURLYWOOD2
BURLYWOOD3
BURLYWOOD4
CADETBLUE
CADETBLUE1
CADETBLUE2
CADETBLUE3
CADETBLUE4
CADET_BLUE
CHARTREUSE
CHARTREUSE1
CHARTREUSE2
CHARTREUSE3
CHARTREUSE4
CHOCOLATE
CHOCOLATE1
CHOCOLATE2
CHOCOLATE3
CHOCOLATE4
CORAL
CORAL1
CORAL2
CORAL3
CORAL4
CORNFLOWERBLUE
CORNFLOWER_BLUE
CORNSILK
CORNSILK1
CORNSILK2
CORNSILK3
CORNSILK4
CRIMSON
CYAN
CYAN1
CYAN2
CYAN3
CYAN4
DARKBLUE
DARKCYAN
DARKGOLDENROD
DARKGOLDENROD1
DARKGOLDENROD2
DARKGOLDENROD3
DARKGOLDENROD4
DARKGRAY
DARKGREEN
DARKGREY
DARKKHAKI
DARKMAGENTA
DARKOLIVEGREEN
DARKOLIVEGREEN1
DARKOLIVEGREEN2
DARKOLIVEGREEN3
DARKOLIVEGREEN4
DARKORANGE
DARKORANGE1
DARKORANGE2
DARKORANGE3
DARKORANGE4
DARKORCHID
DARKORCHID1
DARKORCHID2
DARKORCHID3
DARKORCHID4
DARKRED
DARKSALMON
DARKSEAGREEN
DARKSEAGREEN1
DARKSEAGREEN2
DARKSEAGREEN3
DARKSEAGREEN4
DARKSLATEBLUE
DARKSLATEGRAY
DARKSLATEGRAY1
DARKSLATEGRAY2
DARKSLATEGRAY3
DARKSLATEGRAY4
DARKSLATEGREY
DARKTURQUOISE
DARKVIOLET
DARK_BLUE
DARK_CYAN
DARK_GOLDENROD
DARK_GRAY
DARK_GREEN
DARK_GREY
DARK_KHAKI
DARK_MAGENTA
DARK_OLIVE
DARK_ORANGE
DARK_ORCHID
DARK_RED
DARK_SALMON
DARK_SEA
DARK_SLATE
DARK_TURQUOISE
DARK_VIOLET
DEEPPINK
DEEPPINK1
DEEPPINK2
DEEPPINK3
DEEPPINK4
DEEPSKYBLUE
DEEPSKYBLUE1
DEEPSKYBLUE2
DEEPSKYBLUE3
DEEPSKYBLUE4
DEEP_PINK
DEEP_SKY
DIMGRAY
DIMGREY
DIM_GRAY
DIM_GREY
DODGERBLUE
DODGERBLUE1
DODGERBLUE2
DODGERBLUE3
DODGERBLUE4
DODGER_BLUE
FIREBRICK1
FIREBRICK2
FIREBRICK3
FIREBRICK4
FIREBRICK_34
FLORALWHITE
FLORAL_WHITE
FORESTGREEN
FOREST_GREEN
FUCHSIA
GAINSBORO
GHOSTWHITE
GHOST_WHITE
GOLD
GOLD1
GOLD2
GOLD3
GOLD4
GOLDENROD
GOLDENROD1
GOLDENROD2
GOLDENROD3
GOLDENROD4
GRAY
GRAY0
GRAY1
GRAY2
GRAY3
GRAY4
GRAY5
GRAY6
GRAY7
GRAY8
GRAY9
GRAY10
GRAY11
GRAY12
GRAY13
GRAY14
GRAY15
GRAY16
GRAY17
GRAY18
GRAY19
GRAY20
GRAY21
GRAY22
GRAY23
GRAY24
GRAY25
GRAY26
GRAY27
GRAY28
GRAY29
GRAY30
GRAY31
GRAY32
GRAY33
GRAY34
GRAY35
GRAY36
GRAY37
GRAY38
GRAY39
GRAY40
GRAY41
GRAY42
GRAY43
GRAY44
GRAY45
GRAY46
GRAY47
GRAY48
GRAY49
GRAY50
GRAY51
GRAY52
GRAY53
GRAY54
GRAY55
GRAY56
GRAY57
GRAY58
GRAY59
GRAY60
GRAY61
GRAY62
GRAY63
GRAY64
GRAY65
GRAY66
GRAY67
GRAY68
GRAY69
GRAY70
GRAY71
GRAY72
GRAY73
GRAY74
GRAY75
GRAY76
GRAY77
GRAY78
GRAY79
GRAY80
GRAY81
GRAY82
GRAY83
GRAY84
GRAY85
GRAY86
GRAY87
GRAY88
GRAY89
GRAY90
GRAY91
GRAY92
GRAY93
GRAY94
GRAY95
GRAY96
GRAY97
GRAY98
GRAY99
GRAY100
GREEN
GREEN1
GREEN2
GREEN3
GREEN4
GREENYELLOW
GREEN_YELLOW
GREY
GREY0
GREY1
GREY2
GREY3
GREY4
GREY5
GREY6
GREY7
GREY8
GREY9
GREY10
GREY11
GREY12
GREY13
GREY14
GREY15
GREY16
GREY17
GREY18
GREY19
GREY20
GREY21
GREY22
GREY23
GREY24
GREY25
GREY26
GREY27
GREY28
GREY29
GREY30
GREY31
GREY32
GREY33
GREY34
GREY35
GREY36
GREY37
GREY38
GREY39
GREY40
GREY41
GREY42
GREY43
GREY44
GREY45
GREY46
GREY47
GREY48
GREY49
GREY50
GREY51
GREY52
GREY53
GREY54
GREY55
GREY56
GREY57
GREY58
GREY59
GREY60
GREY61
GREY62
GREY63
GREY64
GREY65
GREY66
GREY67
GREY68
GREY69
GREY70
GREY71
GREY72
GREY73
GREY74
GREY75
GREY76
GREY77
GREY78
GREY79
GREY80
GREY81
GREY82
GREY83
GREY84
GREY85
GREY86
GREY87
GREY88
GREY89
GREY90
GREY91
GREY92
GREY93
GREY94
GREY95
GREY96
GREY97
GREY98
GREY99
GREY100
HONEYDEW
HONEYDEW1
HONEYDEW2
HONEYDEW3
HONEYDEW4
HOTPINK
HOTPINK1
HOTPINK2
HOTPINK3
HOTPINK4
HOT_PINK
INDIANRED
INDIANRED1
INDIANRED2
INDIANRED3
INDIANRED4
INDIAN_RED
INDIGO
IVORY
IVORY1
IVORY2
IVORY3
IVORY4
KHAKI
KHAKI1
KHAKI2
KHAKI3
KHAKI4
LAVENDER
LAVENDERBLUSH
LAVENDERBLUSH1
LAVENDERBLUSH2
LAVENDERBLUSH3
LAVENDERBLUSH4
LAVENDER_BLUSH
LAWNGREEN
LAWN_GREEN
LEMONCHIFFON
LEMONCHIFFON1
LEMONCHIFFON2
LEMONCHIFFON3
LEMONCHIFFON4
L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ATEBLUE
MEDIUMSPRINGGREEN
MEDIUMTURQUOISE
MEDIUMVIOLETRED
MEDIUM_AQUAMARINE
MEDIUM_BLUE
MEDIUM_ORCHID
MEDIUM_PURPLE
MEDIUM_SEA
MEDIUM_SLATE
MEDIUM_SPRING
MEDIUM_TURQUOISE
MEDIUM_VIOLET
MIDNIGHTBLUE
MIDNIGHT_BLUE
MINTCREAM
MINT_CREAM
MISTYROSE
MISTYROSE1
MISTYROSE2
MISTYROSE3
MISTYROSE4
MISTY_ROSE
MOCCASIN
NAVAJOWHITE
NAVAJOWHITE1
NAVAJOWHITE2
NAVAJOWHITE3
NAVAJOWHITE4
NAVAJO_WHITE
NAVY
NAVYBLUE
NAVY_BLUE
OLDLACE
OLD_LACE
OLIVE
OLIVEDRAB
OLIVEDRAB1
OLIVEDRAB2
OLIVEDRAB3
OLIVEDRAB4
OLIVE_DRAB
ORANGE
ORANGE1
ORANGE2
ORANGE3
ORANGE4
ORANGERED
ORANGERED1
ORANGERED2
ORANGERED3
ORANGERED4
ORANGE_RED
ORCHID
ORCHID1
ORCHID2
ORCHID3
ORCHID4
PALEGOLDENROD
PALEGREEN
PALEGREEN1
PALEGREEN2
PALEGREEN3
PALEGREEN4
PALETURQUOISE
PALETURQUOISE1
PALETURQUOISE2
PALETURQUOISE3
PALETURQUOISE4
PALEVIOLETRED
PALEVIOLETRED1
PALEVIOLETRED2
PALEVIOLETRED3
PALEVIOLETRED4
PALE_GOLDENROD
PALE_GREEN
PALE_TURQUOISE
PALE_VIOLET
PAPAYAWHIP
PAPAYA_WHIP
PEACHPUFF
PEACHPUFF1
PEACHPUFF2
PEACHPUFF3
PEACHPUFF4
PEACH_PUFF
PERU
PINK
PINK1
PINK2
PINK3
PINK4
PLUM
PLUM1
PLUM2
PLUM3
PLUM4
POWDERBLUE
POWDER_BLUE
PURPLE
PURPLE1
PURPLE2
PURPLE3
PURPLE4
REBECCAPURPLE
REBECCA_PURPLE
RED
RED1
RED2
RED3
RED4
ROSYBROWN
ROSYBROWN1
ROSYBROWN2
ROSYBROWN3
ROSYBROWN4
ROSY_BROWN
ROYALBLUE
ROYALBLUE1
ROYALBLUE2
ROYALBLUE3
ROYALBLUE4
ROYAL_BLUE
SADDLEBROWN
SADDLE_BROWN
SALMON
SALMON1
SALMON2
SALMON3
SALMON4
SANDYBROWN
SANDY_BROWN
SEAGREEN
SEAGREEN1
SEAGREEN2
SEAGREEN3
SEAGREEN4
SEASHELL
SEASHELL1
SEASHELL2
SEASHELL3
SEASHELL4
SEA_GREEN
SIENNA
SIENNA1
SIENNA2
SIENNA3
SIENNA4
SILVER
SKYBLUE
SKYBLUE1
SKYBLUE2
SKYBLUE3
SKYBLUE4
SKY_BLUE
SLATEBLUE
SLATEBLUE1
SLATEBLUE2
SLATEBLUE3
SLATEBLUE4
SLATEGRAY
SLATEGRAY1
SLATEGRAY2
SLATEGRAY3
SLATEGRAY4
SLATEGREY
SLATE_BLUE
SLATE_GRAY
SLATE_GREY
SNOW
SNOW1
SNOW2
SNOW3
SNOW4
SPRINGGREEN
SPRINGGREEN1
SPRINGGREEN2
SPRINGGREEN3
SPRINGGREEN4
SPRING_GREEN
STEELBLUE
STEELBLUE1
STEELBLUE2
STEELBLUE3
STEELBLUE4
STEEL_BLUE
TAN
TAN1
TAN2
TAN3
TAN4
TEAL
THISTLE
THISTLE1
THISTLE2
THISTLE3
THISTLE4
TOMATO
TOMATO1
TOMATO2
TOMATO3
TOMATO4
TURQUOISE
TURQUOISE1
TURQUOISE2
TURQUOISE3
TURQUOISE4
VIOLET
VIOLETRED
VIOLETRED1
VIOLETRED2
VIOLETRED3
VIOLETRED4
VIOLET_RED
WEBGRAY
WEBGREEN
WEBGREY
WEBMAROON
WEBPURPLE
WEB_GRAY
WEB_GREEN
WEB_GREY
WEB_MAROON
WEB_PURPLE
WHEAT
WHEAT1
WHEAT2
WHEAT3
WHEAT4
WHITE
WHITESMOKE
WHITE_SMOKE
X11_GRAY
X11GRAY
X11_GREY
X11GREY
X11_GREEN
X11GREEN
X11_MAROON
X11MAROON
X11_PURPLE
X11PURPLE
YELLOW
YELLOW1
YELLOW2
YELLOW3
YELLOW4
YELLOWGREEN
YELLOW_GREEN

Traits

Algorithm2D

Implement these for handling conversion to/from 2D coordinates (they are separate, because you might want Dwarf Fortress style 3D!)

Algorithm3D

Implement these for handling conversion to/from 2D coordinates (they are separate, because you might want Dwarf Fortress style 3D!)

BaseMap

Implement this trait to support path-finding functions.

Console

Trait that must be implemented by console types.

GameState

Implement this trait on your state struct, so the engine knows what to call on each tick.

Functions

a_star_search

Request an A-Star search. The start and end are specified as index numbers (compatible with your BaseMap implementation), and it requires access to your map so as to call distance and exit determinations.

add_named_colors_to_palette

Insert all named W3C colors into the palette

clear_command_buffer

Clears the global command buffer. This is called internally by BTerm at the end of each frame. You really shouldn't need to call this yourself.

clear_palette

Empties the palette

draw_bar_horizontal

Draws a horizontal progress bar

draw_bar_vertical

Draws a vertical progress bar

draw_box

Draws a box, starting at x/y with the extents width/height using CP437 line characters

draw_box_double

Draws a box, starting at x/y with the extents width/height using CP437 line characters

draw_hollow_box

Draw a single-lined box without filling in the middle

draw_hollow_box_double

Draws a box, starting at x/y with the extents width/height using CP437 line characters

field_of_view

Calculates field-of-view for a map that supports Algorithm2D.

field_of_view_set

Calculates field-of-view for a map that supports Algorithm2D, returning a HashSet. This is a bit faster than coercing the results into a vector, since internally it uses the set for de-duplication.

init_raw
letter_to_option

For A-Z menus, translates the keys A through Z into 0..25

line2d

Plots a line between two 2D points and returns a vector of points along the line.

line2d_bresenham

Uses a Bresenham's algorithm to plot a line between two points. On some CPUs, this is faster than Bresenham.

line2d_vector

Uses a 2D vector algorithm to plot a line between two points. On some CPUs, this is faster than Bresenham.

log
main_loop

Runs the BTerm application, calling into the provided gamestate handler every tick.

palette_color

Retrieve a palette color by name from the global registry.

parse_dice_string
project_angle

From a given start point, project forward radius units at an angle of angle_radians degrees. 0 Degrees is north (negative Y), 90 degrees is east (positive X)

register_palette_color

Register a palette color by name with the global registry.

render_draw_buffer

Submits the current batch to the BTerm buffer and empties it

string_to_cp437

Converts a string into a vector of u8, CP437 representations of the string

to_char
to_cp437

Converts a unicode character to a CP437 equivalent, returning 0 if it didn't have a match

xp_to_console

Applies an XpFile to a given console, with 0,0 offset by offset_x and offset-y.

Type Definitions

BError
FontCharType
GlCallback
PointF
RltkError