Bug? Why is alpha=0 same with isVisible=false

Hi,

I'm now developing a app and I need to use nativeTextField in it.

Because we can not customize nativeTextField I found a simple trick. I created a text and customized it. Then I created nativeTextfield object above it. I set its alpha property to 0. So users think they clicked the text but they actually click the nativeTextField object. Then text object will update its text property when user enters something.

When I tested this on iOS Simulator I saw that nativeTextField object cannot be clicked. When I set its alpha property to 0.1 it can be clicked but also it can be seen.

I think setting alpha property to 0 is same with setting isVisible property to false. But why? Is this a bug or?

Not a bug, rather a feature. Just use object.isHitTestable

Wow - object.isHitTestable seems like a great solution. I have used to put the object.alpha = 0.001 as a ugly way to hack my way around this.

Just to clarify, this isn't a bug.

Alpha - 0 IS the same as obj.isVisible = false - both make an object invisible.

obj.hitTestable means it can still be used for functions.

Peach :)

views:1446 update:2011/9/26 15:43:22
corona forums © 2003-2011