Skip to content

rq.SpriteOpts ​

since 1.9.0

Options for rq.sprite.new and Sprite:set.

new needs one of gif, flash, cg, fill or text; set changes only the options given. A CG that rq.image.replace or compose changes is shown as it is now.

Fields ​

NameTypeDescription
gif (optional)stringA GIF file in the mod's folder, or an rq.image.add_gif key. It plays over and over from the start. Since 1.10.0.
flash (optional)stringAn rq.image.add_flash key, or a game Flash file's name as in rq.image.add_gif. It plays over and over from frame 1, at 30 frames a second, its actions and sounds as in the game; the stage is its size. Since 2.63.0.
sound (optional)booleanfalse keeps a Flash file's sounds quiet. Default true. Since 2.63.0.
fps (optional)numberFrames a second for the GIF or the Flash file, 0 to 240; 0 (default) uses the GIF's own delays, and a Flash file's 30. Since 1.10.0; Flash since 2.63.0.
clock (optional)"game"|"real"GIFs, Flash files and motion run on the game's clock, which follows rq.speed (default), or on real time. Since 1.10.0.
cg (optional)integerA CG number; rq.image.add gives one for a file in the mod.
src (optional){x: integer, y: integer, w: integer, h: integer}|falseA part of the CG; false for the whole again.
fill (optional){r: integer, g: integer, b: integer, a?: integer}A color; needs w and h.
text (optional)stringText in the HUD font.
size (optional)numberText size, 4 to 200. Default 16.
color (optional){r: integer, g: integer, b: integer}Text color. Default white.
edge (optional)booleanThe text's dark edge. Default true.
bold (optional)booleanBold text. Default false.
x (optional)numberLeft edge before scale and turn, in game pixels.
y (optional)numberTop edge before scale and turn, in game pixels.
w (optional)numberStretch to this width; 0 for its own.
h (optional)numberStretch to this height; 0 for its own.
scale (optional)numberSets both scale_x and scale_y.
scale_x (optional)numberHorizontal scale, around origin.
scale_y (optional)numberVertical scale, around origin.
rotate (optional)numberDegrees, clockwise on screen, around origin.
origin (optional){x: number, y: number}|"center"In the sprite's own pixels from its top left. Default {0, 0}.
alpha (optional)integerOpacity, 0 to 255.
tint (optional){r: integer, g: integer, b: integer}Multiplies the colors.
add (optional){r: integer, g: integer, b: integer}Added to the colors before the tint.
blend (optional)"normal"|"add""add" adds it to what is under it, for light and glow. Default "normal".
show (optional)booleanShown. Default true.
z (optional)integer|"back"|"cards"|"under_windows"|"top"A number, or "back" (0, behind all of the game's), "cards" (300, over a fight's cards and the dungeon view, under the bottom bar), "under_windows" (1000, the default: under messages, menus, fades and Config) or "top" (20000, over all of the game's).
keep (optional)"screen"|"removed""screen" removes it when rq.ui.get().screen is no longer the one it was made on. Default "removed": it stays until the mod, a load or the title removes it.
attach (optional)rq.SpriteAttach |falseFollows a target; x, y and z are added to its (z default 1). false lets it go. Since 1.11.0.

Used by ​

rq.Sprite:set, rq.sprite.new