Image component doesn't have addControl property

Hi guys

I am using babylon version 4.0.0-alpha.10.I can’t access addControl method of gui Image.
Any idea.

Hi, madclaws!

We’d be happy to assist you if you posted up some examples of your code! Just from the way you worded it though, my guess is that you’re trying to use addControl directly on a gui image, and that actually isn’t possible because the gui image is already a control itself. You should be using addControl on a gui container or a fullscreenUI dynamic texture in order to add that image to the container and then continue to stack whatever you need on top of it as far as I know.

That’s just my guess though. As for your second problem, I’m sure someone who has more experience with the inspector will be able to answer that for you.

1 Like

Yes i was trying to add addControl() directly to gui image. But I can add addControl to a gui button.

Oh i got it Button is not a control type, it’s rectangle type.

Oh yeah, that does seem to be the case! I was going to say the method wasn’t listed in the API, but I wouldn’t have been able to explain why. Image - Babylon.js Documentation

That makes sense then! Are you having trouble achieving an effect the way it is?

I got confused because i could access addControl() of gui image on playground.
No trouble, what i actually have to do is create a container and add gui image controls as child to it.

1 Like

Ah perfect, good to hear. Hopefully someone else will come along for your inspector problem in that case if you don’t stumble upon it yourself. Best of luck! :ok_hand:

I think i have to post inspector issue as a separate question.

Might as well! Don’t forget to mark a solution to close the thread :+1: