So attached is a sprite sheet with different sized sprites.
I want them all to be scaled to the size of the banana when displayed in corona.
Without physically changing the size of the pictures and not knowing what the dimensions of the sprites should be made to, how would i do it within corona.
Here is the spritesheet code:
-- -- created with TexturePacker (http://www.codeandweb.com/texturepacker) -- -- $TexturePacker:SmartUpdate:abc8a79cec71f81c2d734456506cbd9e:4ce07956c8b11ae5004161f200ff782a:9c519dc4da464f2a30daa98e61c4961f$ -- -- local sheetInfo = require("mysheet") -- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetInfo:getSheet() ) -- local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} ) -- local SheetInfo = {} SheetInfo.sheet = { frames = { { -- Charmander x=3047, y=1, width=354, height=408, sourceX = 31, sourceY = 5, sourceWidth = 420, sourceHeight = 420 }, { -- Banana x=3047, y=669, width=234, height=146, sourceX = 8, sourceY = 33, sourceWidth = 256, sourceHeight = 256 }, { -- Zelda x=1, y=1, width=642, height=862, sourceX = 39, sourceY = 19, sourceWidth = 700, sourceHeight = 900 }, { -- Car x=645, y=1, width=2400, height=852, }, { -- Dog x=3047, y=411, width=256, height=256, }, }, sheetContentWidth = 3402, sheetContentHeight = 864 } SheetInfo.frameIndex = { ["Charmander"] = 1, ["Banana"] = 2, ["Zelda"] = 3, ["Car"] = 4, ["Dog"] = 5, } function SheetInfo:getSheet() return self.sheet; end function SheetInfo:getFrameIndex(name) return self.frameIndex[name]; end return SheetInfo