../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
sspr(sprite,sx,sy,sw,sh,x,y,[dw],[dh][flip_x],[flip_y])
Overview
sspr draws a sprite, similar to spr(), but allows you to also resize the sprite.
This is scaling sprites, e.g: zoom
Source: source.lua
Arguments
sprite: index or userdata u8
What is drawn to the screen
sx,sy: number
The coordinates of what is treated as the top left of sprite, allowing you to add offsets
sw,sh: number
The width & height of sprite - allows you to crop the sprite.
dx,dy: number
Where the sprite is to be drawn on screen
[dw],[dh]: number
Optional, defaults to the proportions of the sprite
The new width & height of sprite.
sprite will be drawn rescaled to match the proportions of [dw],[dh].
[flip_x],[flip_y]
Flips the sprite on their respective axis
Examples
local mapUD=userdata("u8",480,270)
set_draw_target(mapUD) --all graphical operations now go to the map userdata
map() --draw map
set_draw_target() --return graphical operations to the window/screen
--mapwidth,mapheight is the proportions of the map
--x,y is where to draw the map
sspr(mapUD,0,0,mapwidth,mapheight,x,y,mapwidth*2,mapheight*2)
Returns
Unknown