I’m trying to use the newTexture API but getting inconsistent results. The simple code below should produce a horizontal rect 50x20 but I’m getting different sizes and even orientation when displaying the resulted texture on various simulator devices. Why?
local t1 = display.newRect(0,0,50,20) local tex = graphics.newTexture( { type="canvas", width=t1.contentWidth, height=t1.contentHeight } ) tex:draw(t1) tex:invalidate() local t3 = display.newImage(tex.filename, tex.baseDir) t3.x = 300 t3.y = 300
I need to reliably reproduce a group of objects look when I render them to the texture and then display them in the app.