I have a problem with this code - when I spin the rotating physics object ("spinner"), the text in the welded text object disappears. In hybrid mode the orange outline of the text object remains visible and spins along with the "spinner," but the actual letters are no longer visible. You can cut and paste to view if you have a second and want to look. I'm new to the physics stuff and I'd appreciate any thoughts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | local physics = require "physics" physics.start() physics.setGravity( 0, 0 ) physics.setDrawMode( "hybrid" ) display.setStatusBar(display.HiddenStatusBar) local background = display.newRect ( 0,0, 800, 1400 ) background:setFillColor(250,250,250) local spinner = display.newCircle( 200, 750, 600 ) spinner:setFillColor(0,0,0) physics.addBody( spinner, { radius = 600 } ) local textObject4 = display.newRetinaText( "Test the Text", 300, 750, nil, 40 ) textObject4:setTextColor( 250,250,250 ) physics.addBody( textObject4 ) myJoint = physics.newJoint( "weld", textObject4, spinner, 300,750 ) local velocityVar = nil --------------------------------------------------------------- function background:touch( event ) if event.phase == "began" then firstTime = (event.time/1000 ) startPos = event.y elseif event.phase == "moved" then endPos = event.y lastTime = (event.time/1000 ) finalLength = endPos - startPos finalTime = lastTime - firstTime velocityVar = (finalLength / finalTime) /5 spinTimeVar = velocityVar * 4 if velocityVar > 0 then spinner.angularVelocity = velocityVar end elseif event.phase == "ended" then spinTimeVar = velocityVar * 4 dampVar = .25 local function stopIt (event) spinner.angularDamping = dampVar end timer.performWithDelay ( spinTimeVar, stopIt) end return true end background:addEventListener( "touch", background ) |
No problem on OSX Lion, Corona Simulator, build 2011.715
Text remains visible at all times.
Thanks, running identical setup so it made me go back and fiddle with any setting I could find. Turned out that antialias = true in config was the culprit. Deleting that line entirely did the trick, I really appreciate the second set of eyes.
Kevin
Great that you got it working!
I'd recommend filing a bug report with Ansca though as the antialias setting shouldn't make the text disappear.