summaryrefslogtreecommitdiff
path: root/meta/3rd/Defold/library/sprite.lua
blob: 6e909d15fea7f1d41f324f3b548270a49587f542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---Sprite API documentation
---Sprite API documentation
---@class sprite
sprite = {}
---Play an animation on a sprite component from its tile set
---An optional completion callback function can be provided that will be called when
---the animation has completed playing. If no function is provided,
---a animation_done <> message is sent to the script that started the animation.
---@param url string|hash|url # the sprite that should play the animation
---@param id  # hash name hash of the animation to play
---@param complete_function (fun(self: object, message_id: hash, message: table, sender: number))? # function to call when the animation has completed.
---@param play_properties table? # optional table with properties:
function sprite.play_flipbook(url, id, complete_function, play_properties) end

---Sets horizontal flipping of the provided sprite's animations.
---The sprite is identified by its URL.
---If the currently playing animation is flipped by default, flipping it again will make it appear like the original texture.
---@param url string|hash|url # the sprite that should flip its animations
---@param flip boolean # true if the sprite should flip its animations, false if not
function sprite.set_hflip(url, flip) end

---Sets vertical flipping of the provided sprite's animations.
---The sprite is identified by its URL.
---If the currently playing animation is flipped by default, flipping it again will make it appear like the original texture.
---@param url string|hash|url # the sprite that should flip its animations
---@param flip boolean # true if the sprite should flip its animations, false if not
function sprite.set_vflip(url, flip) end




return sprite