Sprite.setCorners

From MiniScript Wiki
Jump to navigation Jump to search

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