I now got it working with CorelDraw. Steps in case anyone lands here looking for this:
- Use CorelDraw to draw rectangles, Set the document properties to your respective Corona project configuration.
- Export as SVG. Save the file somewhere in a data folder in your project.
- Read in the text file data, split towards the matrix parts.
- Convert the matrix to a degrees rotation.
- Create respective sprites.
Below is some code from my project (not standalone, but it shows the idea):
function self:createMap() local mapNames = { 'Tree', 'Vertigo', 'Chambers', 'Bouncer', 'Road to Portal', 'Tilt Quest', 'Birds' } local mapName = nil; mapNumber = nil local foundGoodMap = false local offsetX = 72; offsetY = 50 foundGoodMap = false while not foundGoodMap do mapName, mapNumber = misc.getRandomEntryAndIndex(mapNames) foundGoodMap = mapName ~= app.lastMapName end app.lastMapName = mapName local bars, bumpers, portals = appGetElementsFromSvg(mapNumber, mapName) for i = 1, #bars do local values = bars[i] local x = values[5]; local y = values[6] local rotation = 360 - ( math.floor( math.deg( math.atan2(values[3], values[4]) ) ) % 360 ) x = x + offsetX; y = y + offsetY app.spritesHandler:createBar( math.floor(x), math.floor(y), rotation ) end for i = 1, #bumpers do app.spritesHandler:createBouncer(bumpers[i].x, bumpers[i].y) end for i = 1, #portals do app.spritesHandler:createPortal(portals[i].x, portals[i].y) end end function appGetElementsFromSvg(mapNumber, mapName) local bars = {}; local bumpers = {}; local portals = {} local mapFileName = string.lower(mapName) mapFileName = string.gsub(mapFileName, ' ', '-') mapFileName = mapNumber .. '-' .. mapFileName .. '.svg' local svg = misc.getFileText('data/' .. mapFileName, system.ResourceDirectory) local lines = misc.split(svg, '\n') local function getPositionFromSVGCircle(dataLine) local x = nil; local y = nil for thisX in string.gmatch( dataLine, ' cx=%"(.-)%"' ) do x = tonumber(thisX) end for thisY in string.gmatch( dataLine, ' cy=%"(.-)%"' ) do y = tonumber(thisY) end return {x = x, y = y} end local indicators = { bar = ' \<rect class="fil', bumper = ' r="33"', portal = ' r="34"' } for i = 1, #lines do local line = lines[i] if string.find(line, indicators.bar, 0, true) ~= nil then for matrix in string.gmatch( line, '%((.-)%)' ) do bars[#bars + 1] = misc.split(matrix, ' ') for valueI = 1, #bars[#bars] do bars[#bars][valueI] = tonumber( bars[#bars][valueI] ) end end elseif string.find(line, indicators.bumper, 0, true) ~= nil then bumpers[#bumpers + 1] = getPositionFromSVGCircle(line) elseif string.find(line, indicators.portal, 0, true) ~= nil then portals[#portals + 1] = getPositionFromSVGCircle(line) end end return bars, bumpers, portals end function self:createBar(x, y, rotation) local function handle(self) if self.y + (self.height / 2 + 1) \<= app.minY then self.gone = true app.spritesHandler:createWaveEffect(self.x, self.y, true) appRestart() end if math.random(0, 10000) \<= 1 then app.spritesHandler:createBling(self.x, self.y, 25) end end local subtype = math.random(1, app.maxBarSubtypes) local width = 126; local height = 19 local self = spriteModule.spriteClass('rectangle', 'bar', subtype, 'bar/' .. subtype, true, x, y, width, height) self.bodyType = 'kinematic' self.doDieOutsideField = false self.alphaChangesWithEnergy = true self.speedY = app.elementsSpeedY self.isFixedRotation = true appAddSprite(self, handle, moduleGroup) self:setReferencePoint(display.TopLeftReferencePoint) self.rotation = rotation local rectContentX, rectContentY = self:localToContent(0, 0) self.rotation = 0 self:setReferencePoint(display.CenterReferencePoint) self.x, self.y = rectContentX, rectContentY self.rotation = rotation return self end