Wikitude
play_for_work
Forum
FAQ
Documentation
Download
wikitude.com
How can we help you today?
Enter your search term here...
Search
Start a new topic
Discussions
Wikitude SDK (Android, iOS, UWP)
Wikitude SDK Questions or Problems
Change label color
S
Santiago González
started a topic
over 9 years ago
Change label color
5 Comments
Oldest First
Popular
Newest First
Sorted by
Oldest First
S
Santiago González
said
over 9 years ago
Hello!
I am trying to change my label color, but my code is not working. I want the text to be white and the background to be green. This is the code:
var descriptionLabel = new AR.Label(description, 1, {
zOrder: 1,
offsetX: -2,
offsetY: -3,
style.textColor: #FFFFFF,
style.backgroundColor: #008000
});
Any idea?
Thank you in advance!!!
W
Wolfgang Damm
said
over 9 years ago
Style requires an object to be passed. Try following call:
var descriptionLabel = new AR.Label(description, 1, {
zOrder: 1,
offsetX: -2,
offsetY: -3,
style: {textColor: #FFFFFF,
backgroundColor: #008000}
});
S
Santiago González
said
over 9 years ago
Thank you. I did what you told me but If I do it nothing is shown.
This is what I have now:
var descriptionLabel = new AR.Label(description, 1, {
zOrder: 1,
offsetX: 0,
offsetY: -3,
style: {textColor: #FFFFFF,
backgroundColor: #008000}
});
Any other idea? I can't see where the error is.
Thank you in advance.
W
Wolfgang Damm
said
over 9 years ago
my bad, you'll need to put the colors as strings:
var descriptionLabel = new AR.Label(description, 1, {
zOrder: 1,
offsetX: 0,
offsetY: -3,
style: {textColor: "#FFFFFF",
backgroundColor: "#008000"}
});
S
Santiago González
said
over 9 years ago
Aggg, I dind't realize about that. Working now.
Thank you Wolfgang!!
Login
or
Signup
to post a comment
More topics in
Wikitude SDK Questions or Problems
Instatiation of WTArchitectView compile errors
Point of interest - native iOS
Slider
Camera lagging / slow in native Swift application
Create a web service
N-th ImageDrawable not displayed
Radar Example
stop defaultlocationmanager and use architectview.injectlocation ios 10
WTC Size Limit
AngularJS and wikitude
See all 3870 topics
© 2021 Wikitude, a Qualcomm company
Santiago González