EddyVerbruggen / nativescript-ar

Augmented Reality NativeScript plugin
https://www.nativescript.org/blog/preview-of-augmented-reality-in-nativescript
MIT License
118 stars 36 forks source link

Overlay tracked image with dynamic information #104

Closed felicks closed 3 years ago

felicks commented 4 years ago

Hello,

I'm trying to detect certain parts of a machine and want to overlay these parts with further information (colored border and specific text). I already tried to add a UIView after detecting the image, but that's not working so far. Is there another way to add simple text and background information to a tracked image? I found the method "addText", but that is also not working. Do you guys have any tips? best regards felix

nickolanack commented 4 years ago

for simple text I have had success using something similar to the following


import {fromFontIconCode} from "tns-core-modules/image-source";
import { Font} from "tns-core-modules/ui/styling/font";
import { Color } from "tns-core-modules/color";

//...
/*ar or image tracking obj...*/.addImage({
      position: {
        x: 0,
        y: 0,
        z: 1
      },
      image: fromFontIconCode("Hello World", new Font('FontAwesome', 100, 'normal', "100"), new Color("black"));
    }).catch(console.error);

//probably don’t want to use FontAwesome
felicks commented 3 years ago

Thanks a lot!