Start a new topic

How to show drawables text to my .html()

I have tracker and the ouput suitable with the marker. Here is my code :


    createTracker: function createTrackerFn() {
        this.targetCollectionResource = new AR.TargetCollectionResource(World.objectData[0].wto_url, {
            onError: World.onError
        });

        this.tracker = new AR.ObjectTracker(this.targetCollectionResource, {
            onError: World.onError
        });

        for (var i = 0; i < World.objectData.length; i++) {
            this.titleLabel = new AR.Label(World.objectData[i].objectName, 0.4, {
                translate: {
                    y: 0.55
                }
            });

            this.descriptionLabel = new AR.Label(World.objectData[i].objectDesc, 0.3, {
                translate: {
                    y: -0.55
                }
            });

            // this.descriptionLabel = new AR.Label(World.objectData[i].objectDesc, 03)
            this.objectTrackable = new AR.ObjectTrackable(this.tracker, World.objectData[i].objectName, {
                drawables: {
                    cam: [this.titleLabel, this.descriptionLabel]
                },

                onObjectRecognized: World.objectRecognized,
                onObjectLost: World.objectLost,
                onError: World.onError
            });

           

        }
    },

 

and this my index.html code

 

 <div data-role="popup" id="popupBasic" data-transition="slideup">
        <h3 id="object-title" class="poppinmedium"></h3>
        <h4 id="object-desc" class="poppinthin"></h4>
    </div>

 my question is how to make the drawable output in my cam have the same output to my html (the object-title and object-des)

Regards,

Theo


World.objectData[0].wto_url = is my wto url

I have try like this too, but it's doesn't work

 

 createTracker: function createTrackerFn() {
        this.targetCollectionResource = new AR.TargetCollectionResource(World.objectData[0].wto_url, {
            onError: World.onError
        });

        this.tracker = new AR.ObjectTracker(this.targetCollectionResource, {
            onError: World.onError
        });

        for (var i = 0; i < World.objectData.length; i++) {
            this.titleLabel = new AR.Label(World.objectData[i].objectName, 0.4, {
                translate: {
                    y: 0.55
                }
            });

            this.descriptionLabel = new AR.Label(World.objectData[i].objectDesc, 0.3, {
                translate: {
                    y: -0.55
                }
            });

            var textTest = $('#object-title').html(World.objectData[i].objectName)


            // this.descriptionLabel = new AR.Label(World.objectData[i].objectDesc, 03)
            this.objectTrackable = new AR.ObjectTrackable(this.tracker, World.objectData[i].objectName, {
                drawables: {
                    cam: [this.titleLabel, this.descriptionLabel, textTest]
                },

                onObjectRecognized: World.objectRecognized,
                onObjectLost: World.objectLost,
                onError: World.onError
            });



        }
    },

 

the objectName here is has the same name on my wto, to call the target name on :

 

this.tracker, World.objectData[i].objectName

 

Hi,


Can you please provide further details:


  • Which version of the SDK are you using?
  • Are you working with the JS API or the Native API?
  • Are you using any of our Extensions (Cordova, Xamarin, Unity)? If yes, which version are you using?
  • Is this happening with the sample app or in your own app? If it happens with your own app, Does the sample app work on your device?
  • Did you check the samples from the sample app that show labels and how it is handled there (e.g. POI with Label, Cloud Recognition sample - Using Metadata in the response?
  • Please explain the exact issue in more detail - are the values set correctly in the AR.Labels? Or are no values set at all? If the texts are set, provide more details on the exact problem.


Thx and greetings

Nicola

Hi,


I'm using Androdi Javascript API (SDK 8.10)

It's happing on my own apps. I try to get data from my webservice for the tracker detail. And it works. the label showing suitable with the tracker, but it show like on the attached picture (no 1) and what i want is the label show like the picture (no 2). on number to i try put the wit static text.

image



Regards, 

Theo

Hi,


So you wish to add the text to the area shown at the bottom of the screen (in the attached screenshot the white area where now 'neskape 2' is written)? If you wish to have some kind of 'Hub' that is shown on the same area of the screen and not as augmentation that is shown once an object / image target is tracked, then please have a look how the title bar or or the POI detail screen is implemented.


If I missunderstood what you're trying to achieve, please provide further details.


Thx and greetings

Nicola

Login or Signup to post a comment