Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
setFlipX and setFlipY — Gideros Forum

setFlipX and setFlipY

alexzhengalexzheng Guru
edited December 2011 in User experience
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)

Likes: cubuspl42

+1 -1 (+1 / -0 )Share on Facebook

Comments

Sign In or Register to comment.