Difference between revisions of "Sprite.setCorners"
Jump to navigation
Jump to search
(Adding page with basic info and example) |
(No difference)
|
Latest revision as of 00:07, 6 August 2025
Function to change the value of Sprite.corners. Takes a list with 4 elements as a parameter, each element should be a list [x, y].
Example
This will stretch the top of the sprite
sp = new Sprite
sp.image = file.loadImage("/sys/pics/Wumpus.png")
sp.x = 480
sp.y = 320
c = sp.corners
//Moving the top right corner 100 pixels to the right
c[2][0] += 100
//Moving the top left corner 100 pixels to the left
c[3][0] -= 100
sp.setCorners c
display(4).sprites.push sp