Hi guys, I am new to Corona SDK.
Currently I wanna render a button which is polygon shape. I put it in a big atlas and use Sprite Sheet to render it and cut it into frame. But the final result is not as what I expected. It only showed the rectangle shape of the polygon.
The final result
The expectation
My original sprite sheet
My code I used to load it
local menuSpriteSheet = { frames={ { x = 0, y = 0, width = 175, heigh = 150 }, { x = 175, y = 0, width = 244, heigh = 119 } } } local menuAtlas = graphics.newImageSheet("asset/ui-asset.png",menuSpriteSheet) local playBtnSprite = display.newImageRect(menuAtlas,2,244,119) playBtnSprite.x = display.contentCenterX playBtnSprite.y = display.contentCenterY
I tested out with single png file with another polygon shape and not using Image Sheet to load it, only use newImageRect and magically, I can load it. I am so confused at this case.