local maska = Bitmap.new(Texture.new("img/ticket.png")) local sprite = Bitmap.new(Texture.new("img/flag.png")) stage:addChild(maska) stage:addChild(sprite) sprite:setPosition(0,80) --ticket:setVisible(false) -- 1) Clear stencil and set it to '1' for every pixel drawn on 'ticket' maska:setStencilOperation{ --stencilClear = true, --stenciMask = 1, stencilWriteMask = 1, stencilRef = 1, stencilFunc = Sprite.STENCIL_ALWAYS, depthPass = Sprite.STENCIL_REPLACE } --2) Only draw fx1/fx2 if stencil isn't 0 sprite:setStencilOperation{ stencilClear = false, stencilMask = 1, stencilRef = 0, stencilFunc = Sprite.STENCIL_NOTEQUAL } |
обрізка спрайту по масці Gideros Lua
Підписатися на:
Дописи (Atom)