I played with setMatrix,and found that is an awesome function.
It can make some handy functions in other game engine,such as setFlipX and setFlipY.
here is my code snippet:
local bitmap = Bitmap.new(Texture.new("bird.png"))
bitmap:setPosition(140, 220)
bitmap:setAnchorPoint(0.5, 0.5)
stage:addChild(bitmap)
matrix = Matrix.new()
--matrix:setM11(-1) ---flipy
matrix:setM22(-1) --flipx
matrix:setTx(bitmap:getX())
matrix:setTy(bitmap:getY())
bitmap:setMatrix(matrix)
Comments
https://sites.google.com/site/xraystudiogame
to setFlipY, I thought ty should be 0,since only x needs to change.
https://sites.google.com/site/xraystudiogame
For the flip, you can use setScaleX(-1) and setScaleY(-1)