Text elements as physical bodies

Hi,

I’m trying to define text elements as physical bodies:

local obj = display.newText( “HELLO”,0,0, nil, 14 )
physics.addBody( obj, “dynamic”, { density=5.0, friction=0.5, bounce=0.5 } )

Everything works fine until these kind of bodies collide, then the text disappears although the body keeps existing in the scenarie. Sometimes, the hidden text bodies come up for a few millisenconds.

If I active the hybrid mode, I can always see the box where the hidden text is contained.

Any idea to solve this issue?

Thanks,

Isidro

[import]uid: 53514 topic_id: 13118 reply_id: 313118[/import]

I just tested this with two bodies of text and nothing weird happened at all - mind posting your actual code? :slight_smile: [import]uid: 52491 topic_id: 13118 reply_id: 48185[/import]

Thanks Peach,

I’ve been investigating and this problem only happens when antialias=true is set in config.lua.

My code:

main.lua

local physics = require( "physics" )  
  
local mainGroup = display.newGroup()  
  
physics.start()  
--physics.setDrawMode( "hybrid" )  
  
local obj = display.newText( "HELLO",0,0, nil, 14 )  
obj.x=160;obj.y=0  
physics.addBody( obj, "dynamic" )  
  
local ground = display.newRect(0, 350, 320, 50)  
physics.addBody( ground, "static",{ density=10000.0 } )  
  
mainGroup:insert(ground)  
mainGroup:insert(obj)  

config.lua

application =  
{  
 content =  
 {  
 antialias = true  
 },  
}  

I’m using simulator 563 on Mac.

Isidro [import]uid: 53514 topic_id: 13118 reply_id: 48195[/import]

Can you please test with a stable build? (Daily builds are not guaranteed to work perfectly, or even at all ;))

Peach [import]uid: 52491 topic_id: 13118 reply_id: 48315[/import]

Just tried with 591 and the same problem with the “antialias” flag.

Regards
[import]uid: 53514 topic_id: 13118 reply_id: 48667[/import]

@peach pellen: I may confirm text objects do not visible when rotated and when “antialias = true”.
Check Corona example “CoronaSDK/SampleCode/GettingStarted/Clock/”, and add “antialias = true” to config.lua. (Seems like this bug for Mac OS and iOS only, under Windows and Android texts render properly)

>Daily builds are not guaranteed to work perfectly, or even at all
This bug is OK for daily builds, but it’s very frustrating for “stable” build. Now we should delay our release till bugfix. [import]uid: 9058 topic_id: 13118 reply_id: 48998[/import]

Hey,

Can I get your bug number please?

Peach :slight_smile: [import]uid: 52491 topic_id: 13118 reply_id: 49290[/import]